</category>
<command
categoryId="org.tizen.dynamicanalyzer.commands"
- id="org.tizen.dynamicanalyzer.handlers.StartStopTraceHandler"
- name="%StartStopTrace">
- </command>
- <command
- categoryId="org.tizen.dynamicanalyzer.commands"
id="org.tizen.dynamicanalyzer.handlers.SaveTraceHandler"
name="%SaveTrace">
</command>
</command>
<command
categoryId="org.tizen.dynamicanalyzer.commands"
- id="org.tizen.dynamicanalyzer.handlers.BatteryPerspectiveHandler"
- name="%Battery">
- </command>
- <command
- categoryId="org.tizen.dynamicanalyzer.commands"
- id="org.tizen.dynamicanalyzer.views.hold.TestInputHandler"
- name="testInput">
- </command>
- <command
- categoryId="org.tizen.dynamicanalyzer.commands"
id="org.tizen.dynamicanalyzer.handlers.ExitHandler"
name="%Exit">
</command>
name="%OpenTraceComplete">
</command>
<command
+ categoryId="org.tizen.dynamicanalyzer.commands"
id="org.tizen.dynamicanalyzer.handlers.ClearHandler"
name="%Clear">
</command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.StopHandler"
+ name="Stop">
+ </command>
+ <command
+ categoryId="org.tizen.dynamicanalyzer.commands"
+ id="org.tizen.dynamicanalyzer.handlers.StartHandler"
+ name="Start">
+ </command>
</extension>
<extension
point="org.eclipse.ui.handlers">
class="org.tizen.dynamicanalyzer.handlers.ClearHandler"
commandId="org.tizen.dynamicanalyzer.handlers.ClearHandler">
</handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.StartHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.StartHandler">
+ </handler>
+ <handler
+ class="org.tizen.dynamicanalyzer.handlers.StopHandler"
+ commandId="org.tizen.dynamicanalyzer.handlers.StopHandler">
+ </handler>
</extension>
<extension
point="org.eclipse.ui.perspectiveExtensions">
import java.util.List;
import org.tizen.dynamicanalyzer.handlers.ClearHandler;
+import org.tizen.dynamicanalyzer.handlers.StartHandler;
import org.tizen.dynamicanalyzer.model.BaseLogCenter;
import org.tizen.dynamicanalyzer.model.ImageInfo;
import org.tizen.dynamicanalyzer.model.LeakCheckList;
project.init();
leakDetector = new LeakDetector();
+ AnalyzerUtil.executeCommand(StartHandler.ID);
return true;
}
return null;
}
- public static DAPageComposite getCurrentPage() {
- BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID);
- return bv.getTopComposite();
- }
-
- public static List<DAPageComposite> getAllPage() {
- BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID);
- return bv.getMainView().getComposites();
- }
-
public static LeakCheckList getLeakCheckList() {
String path = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH
+ File.separator + AnalyzerConstants.XML_FOLDER_NAME;
public static boolean isAppInfoArrived() {
return appInfoArrived;
}
+
+ public static DAPageComposite getCurrentPage() {
+ BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID);
+ return bv.getTopComposite();
+ }
}
--- /dev/null
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView;
+
+public class StartHandler extends AbstractHandler {
+
+ public final static String ID = StartHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ System.out.println("start handler called!!");
+
+// FunctionUsageProfilingView view = (FunctionUsageProfilingView) AnalyzerManager
+// .getView(FunctionUsageProfilingView.ID);
+// Grid tree = (Grid)view.getControl();
+// tree.setSelectionEnabled(false);
+//
+// LeakView leakView = (LeakView) AnalyzerManager
+// .getView(FunctionUsageProfilingView.ID);
+// Grid leakTree = (Grid)leakView.getControl();
+// leakTree.setSelectionEnabled(false);
+ return null;
+ }
+
+}
--- /dev/null
+package org.tizen.dynamicanalyzer.handlers;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakView;
+import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfilingView;
+
+public class StopHandler extends AbstractHandler {
+
+ public final static String ID = StopHandler.class.getName();
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+// FunctionUsageProfilingView view = (FunctionUsageProfilingView) AnalyzerManager
+// .getView(FunctionUsageProfilingView.ID);
+// Grid tree = (Grid)view.getControl();
+// tree.setSelectionEnabled(true);
+//
+// LeakView leakView = (LeakView) AnalyzerManager
+// .getView(FunctionUsageProfilingView.ID);
+// Grid leakTree = (Grid)leakView.getControl();
+// leakTree.setSelectionEnabled(true);
+ return null;
+ }
+
+}
private Grid grid = null;\r
private Shell tooltip;\r
private Object oldItem;\r
- private boolean sourceButtonToggle;\r
+ private boolean enabled = true;\r
\r
private static final int MARGIN = 5;\r
private static final int SPACING = 0;\r
private static final int TOOLTIP_OFFSET = 5;\r
private static final Cursor sourceCursor = new Cursor(null,\r
ImageResources.VIEW_SOURCE_CURSOR.getImageData(), 0, 0);\r
- private static final Cursor defaultCursor = new Cursor(null,\r
- SWT.CURSOR_ARROW);\r
+ private static Cursor defaultCursor = null;\r
\r
- public TableTooltipListener(Grid table, boolean toggle) {\r
+ public TableTooltipListener(Grid table) {\r
this.grid = table;\r
- this.sourceButtonToggle = toggle;\r
+ defaultCursor = grid.getCursor();\r
}\r
\r
public void handleEvent(Event event) {\r
if (!ToolbarArea.getInstance().getSourceViewEnable()) {\r
return;\r
}\r
+\r
+ int columnHeight = grid.getHeaderHeight();\r
+ boolean isHeader = false;\r
+ if (event.y < columnHeight) {\r
+ isHeader = true;\r
+ }\r
+\r
+ boolean isToggled = ToolbarArea.getInstance()\r
+ .getSourceViewToggleState();\r
+ if (enabled && !isHeader) {\r
+ setViewCursor(isToggled);\r
+ }\r
+\r
GridItem gridItem = null;\r
switch (event.type) {\r
case SWT.Dispose:\r
disposeTooltip();\r
break;\r
case SWT.KeyDown:\r
-\r
- disposeTooltip();\r
- if (!sourceButtonToggle) {\r
- if (SWT.CTRL == event.keyCode) {\r
- grid.setCursor(sourceCursor);\r
- ToolbarArea.getInstance().setSourceViewState(true);\r
- }\r
- }\r
break;\r
case SWT.KeyUp:\r
- if (!sourceButtonToggle) {\r
- if (SWT.CTRL == event.keyCode) {\r
- grid.setCursor(defaultCursor);\r
- ToolbarArea.getInstance().setSourceViewState(false);\r
+ if (SWT.F2 == event.keyCode) {\r
+ isToggled = !isToggled;\r
+ if (enabled && !isHeader) {\r
+ setViewCursor(isToggled);\r
}\r
-\r
- disposeTooltip();\r
+ ToolbarArea.getInstance().setSourceViewState(isToggled);\r
}\r
break;\r
case SWT.MouseEnter:\r
- // grid.setFocus();\r
- if (sourceButtonToggle) {\r
+ grid.setFocus();\r
+ if (isToggled && enabled) {\r
createTooltip(event);\r
- } else {\r
- if (SWT.CTRL == event.stateMask) {\r
- createTooltip(event);\r
- }\r
}\r
break;\r
case SWT.MouseExit:\r
}\r
break;\r
case SWT.MouseDoubleClick:\r
- if (sourceButtonToggle) {\r
+ if (isToggled && enabled) {\r
openIDE(event);\r
- } else {\r
- if (SWT.CTRL == event.stateMask) {\r
- openIDE(event);\r
- }\r
}\r
break;\r
case SWT.MouseHover:\r
grid.setFocus();\r
- if (sourceButtonToggle) {\r
+ if (isToggled && enabled) {\r
createTooltip(event);\r
- } else {\r
- if (SWT.CTRL == event.stateMask) {\r
- createTooltip(event);\r
- }\r
}\r
break;\r
-\r
default:\r
break;\r
}\r
}\r
\r
+ public void setEnable(boolean enabled) {\r
+ this.enabled = enabled;\r
+ }\r
+\r
+ private void setViewCursor(boolean toggled) {\r
+ if (!toggled) {\r
+ grid.setCursor(defaultCursor);\r
+ disposeTooltip();\r
+ } else {\r
+ grid.setCursor(sourceCursor);\r
+ }\r
+ }\r
+\r
private void createErrorPopup(String message) {\r
Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();\r
DADialog warning = new DADialog(shell, SWT.NONE);\r
Integer.toString(sl.getLineNumber()));\r
}\r
\r
- public void setSourceButtonToggle(boolean toggle) {\r
- this.sourceButtonToggle = toggle;\r
- if (sourceButtonToggle) {\r
- grid.setCursor(sourceCursor);\r
- } else {\r
- grid.setCursor(defaultCursor);\r
- }\r
- }\r
-\r
}\r
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
import org.tizen.dynamicanalyzer.ui.info.range.StateManager;
-import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.SymbolNameDemangler;
public class LogParser implements Runnable {
LogInserter.getInsertLogQueue().push(logPack);
LogInserter.startInsertLogThread();
- List<DAPageComposite> pages = AnalyzerManager.getAllPage();
- int size = pages.size();
- for (int i = 0; i < size; i++) {
- pages.get(i).updateLog(logPack);
- }
+ BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID);
+ bv.getMainTab().updateLog(logPack);
}
private void setFuncName(String[] input) {
import org.tizen.dynamicanalyzer.logparser.LogPackage;
import org.tizen.dynamicanalyzer.ui.page.ViewAction;
-
public class DAView extends Composite implements ViewAction {
+ protected String name = null;
public DAView(Composite parent, int style) {
super(parent, style);
}
@Override
- public void setSourceView(boolean enable) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public Control getControl() {
// TODO Auto-generated method stub
return null;
@Override
public void updateView(DASelectionData data) {
// TODO Auto-generated method stub
-
+
}
@Override
public void otherViewSelectionOccured() {
// TODO Auto-generated method stub
-
+
+ }
+ @Override
+ public String getViewName() {
+ return name;
}
}
@Override
public void updateTable() {
- ViewAction va = AnalyzerManager.getCurrentPage().getViews()
+ ViewAction va = AnalyzerManager.getCurrentPage().getViewMap()
.get(FileChartView.ID);
Grid fileChart = ((DAFileChart) va.getControl()).getTree();
GridItem[] selectedItem = fileChart.getSelection();
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.FilePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
-
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
- }
-
- @Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
}
@Override
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.common.DesignConstants;
-import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
-
public class FilePage extends DAPageComposite {
+ public static final String ID = FilePage.class.getName();
+ public static final String TAB_ID = ID + CommonConstants.UNDERBAR + "tab";
public final static int FILECHART_INDEX = 0;
public final static int FILE_API_LIST_INDEX = 1;
public FilePage(Composite parent, int style) {
super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_FILE;
this.setLayout(new FillLayout());
baseForm = new SashForm(this, SWT.HORIZONTAL);
rightForm = new SashForm(baseForm, SWT.VERTICAL);
// INFO_VIEW_INDEX = 2;
- DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE);
+ DATabComposite tabView = new DATabComposite(rightForm, SWT.NONE, TAB_ID);
addView(tabView);
{
CallstackView callstack = new CallstackView(
tabView.getContentComposite(), SWT.NONE);
- tabView.addView(callstack, InformationViewLabels.CALLSTACK_VIEW_TITLE);
+ callstack.setObservingViews(new String[]{FileApiListView.ID});
+ tabView.addView(callstack);
}
// FILE_DETAIL = 3;
package org.tizen.dynamicanalyzer.ui.info.callstack;
+import java.util.List;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
+import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.page.ViewAction;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATreeComposite;
public class CallstackView extends DAView {
public static final String ID = CallstackView.class.getName();
+
private DATableComposite callstackTableComp = null;
private String[] columnNames = {
InformationViewLabels.CALLSTACK_VIEW_FUNCTION,
InformationViewLabels.CALLSTACK_VIEW_BINARY_PATH };
private int[] columnSizes = { 120, 70, 400 };
private boolean[] columnVisibility = { true, true, true };
+ private String[] observingViews = null;
Composite contents = null;
public CallstackView(Composite parent, int style) {
super(parent, style);
+ name = InformationViewLabels.CALLSTACK_VIEW_TITLE;
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, false);
viewContainer.setTitleText(InformationViewLabels.CALLSTACK_VIEW_TITLE);
callstackTableComp.setColumns(columnNames);
callstackTableComp.setColumnSize(columnSizes);
callstackTableComp.setColumnVisibility(columnVisibility);
+ }
+
+ public void setObservingViews(String[] viewIds) {
+ observingViews = viewIds;
+ }
- callstackTableComp.setTableToolTipListener(new TableTooltipListener(
- callstackTableComp.getTable(), false));
+ public String[] getObservingViews() {
+ return observingViews;
+ }
+
+ @Override
+ public void updateView() {
+ if (null == observingViews) {
+ return;
+ }
+ int size = observingViews.length;
+ for (int i = 0; i < size; i++) {
+ ViewAction view = AnalyzerManager.getCurrentPage().getView(
+ observingViews[i]);
+ Control control = view.getControl();
+ Grid table = null;
+ if (control instanceof DATableComposite) {
+ table = ((DATableComposite) control).getTable();
+ } else if (control instanceof DATreeComposite) {
+ table = ((DATreeComposite) control).getTable();
+ } else {
+ continue;
+ }
+ if (table.getSelectionCount() > 0) {
+ GridItem[] selection = table.getSelection();
+ List<String> startData = ((DATableDataFormat) selection[0]
+ .getData()).getData();
+ List<String> endData = ((DATableDataFormat) selection[selection.length - 1]
+ .getData()).getData();
+ long startTime = Long.parseLong(startData
+ .get(LogCenterConstants.TIME_INDEX));
+ long endTime = Long.parseLong(endData
+ .get(LogCenterConstants.TIME_INDEX));
+ DASelectionData data = new DASelectionData(observingViews[i],
+ startTime, endTime, selection, table);
+ updateView(data);
+ return;
+ }
+ }
+ clear();
}
@Override
return callstackTableComp;
}
- @Override
- public void setSourceView(boolean enable) {
- callstackTableComp.setSourceView(enable);
- }
}
public class RangeView extends DAView {
+ public static final String ID = RangeView.class.getName();
+
private DATableComposite tableComp = null;
private String[] columnNames = { InformationViewLabels.RANGE_VIEW_NAME,
InformationViewLabels.RANGE_VIEW_START,
private int[] columnSizes = { 85, 60, 60, 60, 60, 60 };
private boolean[] columnVisibility = { true, true, true, true, true, true };
- public static final String ID = RangeView.class.getName();
public static final int STATE_INIT = 0;
public static final int STATE_RANGE = 1;
public static final int STATE_NO_RANGE = 2;
public RangeView(Composite parent, int style) {
super(parent, style);
- // TODO Auto-generated constructor stub
+ name = InformationViewLabels.RANGE_VIEW_TITLE;
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, false);
tableComp.setSelValueIndex(-1);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
+ tableComp.setTableToolTipEnable(false);
}
@Override
@Override
public void clear() {
- // TODO Auto-generated method stub
lastTime = 0;
tableComp.clear();
}
@Override
- public void setSourceView(boolean enable) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
public Control getControl() {
- // TODO Auto-generated method stub
return null;
}
@Override
public void updateView(DASelectionData data) {
- // TODO Auto-generated method stub
tableComp.updateTable();
}
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
import org.tizen.dynamicanalyzer.ui.widgets.StopProgressDialog;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public void stopTrace() {
if (null != dialog) {
dialog.setProcessSelection(100);
- AnalyzerUtil.changePage(1);
+ AnalyzerUtil.changePage(SummaryPage.ID);
dialog.close();
state = STOP_PROCESS_END;
}
public class SnapshotView extends DAView {
public static final String ID = SnapshotView.class.getName();
-
+
Composite iconComp;
ImageViewer snapshot;
// CircularGraph cpuGrp;
public SnapshotView(Composite parent, int style, boolean title) {
super(parent, style);
+ name = InformationViewLabels.SNAPSHOT_VIEW_TITLE;
this.setLayout(new FillLayout());
ViewContainer viewContainer = new ViewContainer(this, title);
package org.tizen.dynamicanalyzer.ui.page;
+import java.util.HashMap;
+import java.util.List;
+
import org.eclipse.nebula.effects.stw.Transition;
import org.eclipse.nebula.effects.stw.TransitionListener;
import org.eclipse.nebula.effects.stw.TransitionManager;
+import org.eclipse.nebula.effects.stw.Transitionable;
import org.eclipse.nebula.effects.stw.transitions.CubicRotationTransition;
import org.eclipse.nebula.effects.stw.transitions.FadeTransition;
import org.eclipse.nebula.effects.stw.transitions.SlideTransition;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
public abstract class AbstractEffectFrame {
- public static final String[] DIRECTIONS_NAMES = { "Left", "Right", "Up", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- "Down", "Right/Left", "Down/Up", "Random right and left", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- "Random up and down", "Random" }; //$NON-NLS-1$ //$NON-NLS-2$
-
public static final int DIR_LEFT = 0;
public static final int DIR_RIGHT = 1;
public static final int DIR_UP = 2;
public static final int DIR_RANDOM_RIGHT_AND_LEFT = 6;
public static final int DIR_RANDOM_UP_AND_DOWN = 7;
public static final int DIR_RANDOM = 8;
+
+// private boolean effectLock = false; // temporary block variable
+
+ public static final String[] DIRECTIONS_NAMES = { "Left", "Right", "Up", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "Down", "Right/Left", "Down/Up", "Random right and left", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "Random up and down", "Random" }; //$NON-NLS-1$ //$NON-NLS-2$
+ protected Transition[] transitions = null;
+
+ private HashMap<String, DAPageComposite> pages = null;
+ List<Image> images = null;
@SuppressWarnings("unused")
private int selectedDirection = DIR_RANDOM;
protected Composite containerComposite = null;
+ private StackLayout containerLayout = null;
protected TransitionManager tm = null;
public static final int TRANSITION_FADE = 1;
public static final int TRANSITION_SLIDE = 0;
public static final int TRANSITION_CUBIC_ROTATION = 2;
- protected Transition[] transitions;
-
- public void init(Composite parent) {
+ public AbstractEffectFrame(Composite parent) {
+ parent.setLayout(new FillLayout());
containerComposite = new Composite(parent, SWT.NONE);
+ containerLayout = new StackLayout();
+ containerComposite.setLayout(containerLayout);
+ pages = new HashMap<String, DAPageComposite>();
+
+ initTransitions();
+
init();
- // linux supports only two effect
- transitions = new Transition[] { new SlideTransition(tm),
- new FadeTransition(tm), // };
- new CubicRotationTransition(tm) };
- transitions[0].setFPS(60);
- transitions[0].setTotalTransitionTime(1000);
+ containerLayout.topControl = getPage(TimelinePage.ID);
+ containerComposite.layout();
+ }
+
+ private void initTransitions() {
+ tm = new TransitionManager(new Transitionable() {
+
+ @Override
+ public void setSelection(int index) {
+ }
+
+ @Override
+ public int getSelection() {
+ return 0;
+ }
+
+ @Override
+ public double getDirection(int toIndex, int fromIndex) {
+ if (toIndex > fromIndex) {
+ return Transition.DIR_LEFT;
+ } else if (toIndex < fromIndex) {
+ return Transition.DIR_RIGHT;
+ }
+ return Transition.DIR_UP;
+ }
+
+ @Override
+ public Control getControl(int index) {
+// return comps.get(index);
+ return null;
+ }
+
+ @Override
+ public Composite getComposite() {
+ return containerComposite;
+ }
+
+ @Override
+ public void addSelectionListener(SelectionListener listener) {
+ }
+ });
tm.setTransition(transitions[TRANSITION_CUBIC_ROTATION]);
tm.addTransitionListener(new TransitionListener() {
@Override
System.out.println("transition finish"); //$NON-NLS-1$
}
});
+
+ transitions = new Transition[] { new SlideTransition(tm),
+ new FadeTransition(tm), new CubicRotationTransition(tm) };
+ transitions[0].setFPS(60);
+ transitions[0].setTotalTransitionTime(1000);
}
protected abstract void init();
public void setTransitionFPS(long fps) {
tm.getTransition().setFPS(fps);
}
+
+ public HashMap<String, DAPageComposite> getDAPages() {
+ return pages;
+ }
+
+ public void addPage(String ID, DAPageComposite page)
+ {
+ pages.put(ID, page);
+ }
+
+ public DAPageComposite getPage(String ID)
+ {
+ return pages.get(ID);
+ }
+
+
+// public void effect(int fromIndex, int toIndex) {
+// effectLock = true;
+// ToolbarArea.getInstance().getMainButton().setEnabled(false);
+// ToolbarArea.getInstance().getAnalysisButton().setEnabled(false);
+// try {
+// Control from = containerLayout.topControl;
+// Rectangle rect = from.getBounds();
+// Image imgFrom = new Image(from.getDisplay(), rect.width,
+// rect.height);
+// Image prevImage = images.get(fromIndex);
+// images.set(fromIndex, imgFrom);
+// prevImage.dispose();
+//
+// GC gcfrom = new GC(from);
+// from.update();
+// gcfrom.copyArea(imgFrom, 0, 0);
+// gcfrom.dispose();
+//
+// Canvas canvas = new Canvas(containerComposite, SWT.DOUBLE_BUFFERED);
+// canvas.moveAbove(null);
+// canvas.setBounds(rect);
+//
+// GC gcOn = new GC(canvas);
+// tm.getTransition().start(
+// imgFrom,
+// images.get(toIndex),
+// gcOn,
+// tm.getTransitionable().getDirection(selectedStack,
+// currentStack));
+// containerLayout.topControl = comps.get(selectedStack);
+// containerComposite.layout();
+// currentStack = selectedStack;
+// } catch (Exception e) {
+// System.out.println(" application exit..."); //$NON-NLS-1$
+// }
+//
+// effectLock = false;
+// ToolbarArea.getInstance().getMainButton().setEnabled(true);
+// ToolbarArea.getInstance().getAnalysisButton().setEnabled(true);
+// }
+//
+// public void createCaptures(int initial) {
+// images = new ArrayList<Image>();
+// Rectangle rect = containerLayout.topControl.getBounds();
+// for (int i = 0; i < comps.size(); i++) {
+// containerLayout.topControl = comps.get(i);
+// containerComposite.layout();
+// Image img = ImageCapture.getImage(containerLayout.topControl,
+// rect.width, rect.height, true);
+// images.add(img);
+// }
+//
+// containerLayout.topControl = comps.get(initial);
+// containerComposite.layout();
+// }
+//
+// public void excuteEffect(int select) {
+// selectedStack = select;
+// effect(currentStack, selectedStack);
+// }
+//
+// public void setTopComposite(int select) {
+// selectedStack = select;
+// // if (AnalyzerUtil.isWin()) {
+// // effect(currentStack, selectedStack);
+// // } else {
+// containerLayout.topControl = comps.get(selectedStack);
+// containerComposite.layout();
+// currentStack = selectedStack;
+// ((DAPageComposite) containerLayout.topControl).updatePage();
+// ((DAPageComposite) containerLayout.topControl)
+// .setSourceView(ToolbarArea.getInstance()
+// .getSourceViewToggleState());
+// // }
+// }
}
package org.tizen.dynamicanalyzer.ui.page;
+import java.util.HashMap;
+
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.Display;
import org.eclipse.ui.part.ViewPart;
+import org.tizen.dynamicanalyzer.model.DAView;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.summary.SummaryPage;
+import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.userinterface.UserInterfacePage;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class BaseView extends ViewPart {
public static final String ID = BaseView.class.getName();
- Composite contentsComposite;
DAEffectFrame mainView = null;
DAPageComposite topComposite = null;
+ DATabComposite tabView = null;
+
+ private HashMap<String, DAView> views = null;
@Override
public void createPartControl(Composite parent) {
+ tabView = new DATabComposite(parent, SWT.DOUBLE_BUFFERED, null);
+ tabView.setTabWidth(120);
+ {
+ TimelinePage timelinePage = new TimelinePage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(timelinePage);
+ SummaryPage summaryPage = new SummaryPage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(summaryPage);
+ FilePage filePage = new FilePage(tabView.getContentComposite(),
+ SWT.NONE);
+ tabView.addView(filePage);
- contentsComposite = new Composite(parent, SWT.NONE);
- contentsComposite.setLayout(new FillLayout());
+ ThreadPage threadPage = new ThreadPage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(threadPage);
- mainView = new DAEffectFrame();
- mainView.init(contentsComposite);
- mainView.getContainerComposite().setVisible(true);
+ UserInterfacePage uiPage = new UserInterfacePage(
+ tabView.getContentComposite(), SWT.NONE);
+ tabView.addView(uiPage);
+ }
}
@Override
// TODO Auto-generated method stub
}
- public void createCaptures() {
- mainView.createCaptures(0);
- }
-
- public DAEffectFrame getMainView() {
- return mainView;
+ public DATabComposite getMainTab() {
+ return tabView;
}
public DAPageComposite getTopComposite() {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- Composite container = mainView.getContainerComposite();
- StackLayout stack = (StackLayout) container.getLayout();
- topComposite = (DAPageComposite) stack.topControl;
+ topComposite = (DAPageComposite) tabView.getTopComposite();
}
});
return topComposite;
}
public void clear() {
- for (DAPageComposite mc : mainView.comps) {
- mc.clear();
- }
+ tabView.clear();
+ }
+
+ public HashMap<String, DAView> getAllViewHash() {
+ return views;
}
}
public class DAEffectFrame extends AbstractEffectFrame {
+ public DAEffectFrame(Composite parent) {
+ super(parent);
+ // TODO Auto-generated constructor stub
+ }
+
final int MAIN_INDEX = 0;
final int ANALYSIS_INDEX = 1;
final int FILE_INDEX = 2;
containerComposite.layout();
currentStack = selectedStack;
((DAPageComposite) containerLayout.topControl).updatePage();
- ((DAPageComposite) containerLayout.topControl)
- .setSourceView(ToolbarArea.getInstance()
- .getSourceViewToggleState());
// }
}
import java.util.List;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.logparser.LogPackage;
+public class DAPageComposite extends Composite implements ViewAction {
-public class DAPageComposite extends Composite {
-
- List<String> viewNames;
- HashMap<String, ViewAction> views;
+ private HashMap<String, ViewAction> viewMap = null;
+ private List<ViewAction> views = null;
+ protected String name = null;
public DAPageComposite(Composite parent, int style) {
super(parent, style);
- // TODO Auto-generated constructor stub
+ viewMap = new HashMap<String, ViewAction>();
+ views = new ArrayList<ViewAction>();
}
- public List<String> getViewNames() {
- if (viewNames == null) {
- viewNames = new ArrayList<String>();
- }
- return viewNames;
+ public List<ViewAction> getViews() {
+ return views;
}
- public HashMap<String, ViewAction> getViews() {
- if (views == null) {
- views = new HashMap<String, ViewAction>();
- }
- return views;
+ public HashMap<String, ViewAction> getViewMap() {
+ return viewMap;
}
public void updatePage() {
- int size = getViewNames().size();
+ int size = views.size();
for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
- ViewAction view = getViews().get(key);
- if (null != view) {
- view.updateView();
+ if (null != views.get(i)) {
+ views.get(i).updateView();
}
}
}
public void updateLog(LogPackage logPack) {
- int size = getViewNames().size();
+ int size = views.size();
for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
- ViewAction view = getViews().get(key);
- if (null != view) {
- view.updateLog(logPack);
+ if (null != views.get(i)) {
+ views.get(i).updateLog(logPack);
}
}
}
public void clear() {
- int size = getViewNames().size();
+ int size = views.size();
for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
- ViewAction view = getViews().get(key);
- if (null != view) {
- view.clear();
- }
- }
- }
-
- public void setSourceView(boolean enable) {
- int size = getViewNames().size();
- for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
- ViewAction view = getViews().get(key);
- if (null != view) {
- view.setSourceView(enable);
+ if (null != views.get(i)) {
+ views.get(i).clear();
}
}
}
public void updatePage(DASelectionData data) {
String viewId = data.getViewId();
- int size = getViewNames().size();
+ int size = views.size();
for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
+ String key = views.get(i).getClass().getName();
if (key != null && !key.equals(viewId)) {
- ViewAction view = getViews().get(key);
+ ViewAction view = viewMap.get(key);
if (null != view) {
view.updateView(data);
}
}
public void updateSelectedViews(DASelectionData data, List<String> viewNames) {
- String viewId = data.getViewId();
int size = viewNames.size();
for (int i = 0; i < size; i++) {
- String key = viewNames.get(i);
- if (key != null && !key.equals(viewId)) {
- ViewAction view = getViews().get(key);
- if (null != view) {
- view.updateView(data);
- }
- }
+ viewMap.get(viewNames.get(i)).updateView(data);
}
}
-
-
+
public void addView(ViewAction view) {
- getViews().put(view.getClass().getName(), view);
- getViewNames().add(view.getClass().getName());
+ viewMap.put(view.getClass().getName(), view);
+ views.add(view);
}
public void controlSelection(String viewId) {
- int size = getViewNames().size();
+ int size = views.size();
for (int i = 0; i < size; i++) {
- String key = getViewNames().get(i);
+ String key = views.get(i).getClass().getName();
if (key != null && !key.equals(viewId)) {
- ViewAction view = getViews().get(key);
+ ViewAction view = viewMap.get(key);
if (null != view) {
view.otherViewSelectionOccured();
}
}
}
}
+
+ public ViewAction getView(String viewId) {
+ return viewMap.get(viewId);
+ }
+
+ @Override
+ public void updateView() {
+ updatePage();
+ }
+
+ @Override
+ public Control getControl() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void updateView(DASelectionData data) {
+ updatePage(data);
+ }
+
+ @Override
+ public void otherViewSelectionOccured() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public String getViewName() {
+ return name;
+ }
}
public void clear();
- public void setSourceView(boolean enable);
-
public Control getControl();
public void updateView(DASelectionData data);
public void otherViewSelectionOccured();
+
+ public String getViewName();
}
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.common.DesignConstants;
-import org.tizen.dynamicanalyzer.nl.SummaryLabels;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class SummaryPage extends DAPageComposite {
-
+ public static final String ID = SummaryPage.class.getName();
+ public static final String TAB_ID = ID + CommonConstants.UNDERBAR + "tab";
public final static int FAILED_APILIST_VIEW_INDEX = 0;
public final static int LEAK_VIEW_INDEX = 1;
public final static int INFO_VIEW_INDEX = 2;
public SummaryPage(Composite parent, int style) {
super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_SUMMARY;
this.setLayout(new FillLayout());
baseForm = new SashForm(this, SWT.VERTICAL);
addView(leakView);
// INFO_VIEW_INDEX = 2;
- DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE);
+ DATabComposite tabView = new DATabComposite(upperForm, SWT.NONE, TAB_ID);
addView(tabView);
{
SnapshotView currentView = new SnapshotView(
tabView.getContentComposite(), SWT.NONE, false);
- tabView.addView(currentView,
- SummaryLabels.SUMMARY_PAGE_SNAPSHOT_TITLE);
+ tabView.addView(currentView);
CallstackView callstack = new CallstackView(
tabView.getContentComposite(), SWT.NONE);
- tabView.addView(callstack,
- SummaryLabels.SUMMARY_PAGE_CALLSTACK_TITLE);
+ callstack.setObservingViews(new String[]{FailedApiListView.ID, LeakView.ID, WarningListView.ID});
+ tabView.addView(callstack);
}
upperForm.setWeights(new int[] { 37, 40, 23 });
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.SummaryLabels;
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
-
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
}
@Override
}
@Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
- }
-
- @Override
public Control getControl() {
return tableComp;
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.SummaryLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
private int[] columnSizes = { 60, 25, 60, 50, 100, 100 };
private boolean[] columnVisibility = { true, false, true, true, true, true };
int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_NUM,
- AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_GRID,
AnalyzerConstants.SORT_TYPE_NUM,
AnalyzerConstants.SORT_TYPE_STRING,
AnalyzerConstants.SORT_TYPE_STRING };
treeComp.setColumns(columnNames);
treeComp.setColumnSize(columnSizes);
treeComp.setColumnVisibility(columnVisibility);
-
- treeComp.setTableToolTipListener(new TableTooltipListener(treeComp
- .getTable(), false));
-
}
@Override
public void updateView() {
- treeComp.updateTree();
+ treeComp.updateTree();
}
@Override
}
@Override
- public void setSourceView(boolean enable) {
- treeComp.setSourceView(enable);
- }
-
- @Override
public Control getControl() {
return treeComp;
}
String rateStr = item.getText(getColumn());
String[] splitRateStr = rateStr.split("%"); //$NON-NLS-1$
rateStr = new String(splitRateStr[0].trim());
- if ( !rateStr.equals("-")) {
+ String[] splitStr = rateStr.split(":"); //$NON-NLS-1$
+ if ( (!rateStr.equals("-")) && ( splitStr.length < 1) ) {
double rate = Double.parseDouble(rateStr);
Rectangle bounds = getBounds();
int rectWidth = (int) (bounds.width * (rate / 100));
treeComp.setColumns(columnNames);
treeComp.setColumnSize(columnSizes);
treeComp.setColumnVisibility(columnVisibility);
- treeComp.setTableToolTipListener(null);
+ treeComp.setTableToolTipEnable(false);
}
@Override
import org.tizen.dynamicanalyzer.utils.Formatter;
public class ProfilingTable extends DATreeComposite {
-
+ public static final String ID = ProfilingTable.class.getName();
public ProfilingTable(Composite parent, int compStyle, int tableStyle) {
super(parent, compStyle, tableStyle);
setComparator(new TreeDataComparator());
-// setSelValueIndex(0);
comparator.setType(AnalyzerConstants.SORT_TYPE_NUM);
comparator.setColumn(2);
public class WarningDetailView extends DAView {
+ public static final String ID = WarningDetailView.class.getName();
+
private Canvas canvas = null;
private String warningMessage = ""; //$NON-NLS-1$
private final String titleText = SummaryLabels.FILE_DETAILS_TITLE;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.SummaryLabels;
tableComp.setSourceColumns(sourceColumns);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
}
tableComp.updateTable();
}
-
-
@Override
public void clear() {
tableComp.clear();
public void otherViewSelectionOccured() {
tableComp.deselectAll();
}
-
-
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.ThreadPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.basechart.PageChartGraphSeries;
import org.tizen.dynamicanalyzer.ui.basechart.PageChartItem;
import org.tizen.dynamicanalyzer.ui.basechart.table.DAPageAPIListTable;
-import org.tizen.dynamicanalyzer.ui.file.FileApiListView;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
public class ThreadAPIListView extends DAView {
- public static final String ID = FileApiListView.class.getName();
+ public static final String ID = ThreadAPIListView.class.getName();
private int[] columnSizes = { 30, 80, 120, 250, 0, 100, 0 };
DAPageAPIListTable tableComp = null;
tableComp.setColumns(ThreadPageDataManager.getInstance()
.getColumnNamesToArray());
tableComp.setColumnSize(columnSizes);
-
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
- }
-
- @Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
}
@Override
}
bChartSelect = false;
} else {
- if (tableComp.getTable().getItemCount() < graphSeries.getSize() - graphSeries.getInternalItemSize()) {
+ if (tableComp.getTable().getItemCount() < graphSeries.getSize()
+ - graphSeries.getInternalItemSize()) {
for (int j = tableComp.getTable().getItemCount(); j < graphSeries
.getSize(); j++) {
int dataItemIndex = (int) graphSeries.get(j).getY();
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.basechart.chart.DAPageChart;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
public class ThreadPage extends DAPageComposite {
+ public static final String ID = ThreadPage.class.getName();
private ThreadChartView threadChartView;
private ThreadAPIListView threadAPIListView;
// 10 : offset
-// private final double DEFAULT_WIDTH = DesignConstants.SNAPSHOT_VIEW_WIDTH + 10;
-// private final double DEFAULT_HEIGHT = DesignConstants.SNAPSHOT_VIEW_HEIGHT
-// + 10 + DesignConstants.VIEW_TITLEBAR_HEIGHT;
+ // private final double DEFAULT_WIDTH = DesignConstants.SNAPSHOT_VIEW_WIDTH
+ // + 10;
+ // private final double DEFAULT_HEIGHT =
+ // DesignConstants.SNAPSHOT_VIEW_HEIGHT
+ // + 10 + DesignConstants.VIEW_TITLEBAR_HEIGHT;
SashForm baseForm;
SashForm leftForm;
public ThreadPage(Composite parent, int style) {
super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_THREAD;
this.setLayout(new FillLayout());
// baseForm = new SashForm(this, SWT.HORIZONTAL);
leftForm.setWeights(new int[] { 60, 40 });
-// tManager.setPageChart((DAPageChart) threadChartView.getControl()); //FIXME
+ // tManager.setPageChart((DAPageChart) threadChartView.getControl());
+ // //FIXME
}
public void updateLog(LogPackage logPack) {
-// tManager.parsePageData(logPack);
+ // tManager.parsePageData(logPack);
}
}
public class DATimelineTabComposite extends DATabComposite {\r
public static final String ID = DATimelineTabComposite.class.getName();\r
\r
- RangeView rangeView = null;\r
- SnapshotView snapshotView = null;\r
-\r
public DATimelineTabComposite(Composite parent, int style) {\r
- super(parent, style);\r
- // TODO Auto-generated constructor stub\r
- }\r
-\r
- public void addRangeView(Composite child, String title) {\r
- super.addView(child, title);\r
- rangeView = (RangeView) child;\r
- }\r
-\r
- public void addSnapshotView(Composite child, String title) {\r
- super.addView(child, title);\r
- snapshotView = (SnapshotView) child;\r
+ super(parent, style, ID);\r
}\r
\r
- public void updateLog(LogPackage logPack) {\r
- Logs logs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);\r
+ public void updateLog(LogPackage logPack) {\r
+ Logs logs = logPack.getLogs(LogCenterConstants.LOG_DEVICE);\r
if (null == logs || logs.getLogs().size() == 0) {\r
return;\r
}\r
int lastIndex = inputs.size() - 1;\r
List<String> input = inputs.get(lastIndex);\r
\r
- rangeView.setTimeLast(Long\r
- .valueOf(input.get(LogCenterConstants.DEVICE_TIME_INDEX)));\r
- super.updateLog(logPack);\r
- }\r
- \r
+ RangeView rangeView = (RangeView) getTab(RangeView.ID);\r
+ rangeView.setTimeLast(Long.valueOf(input\r
+ .get(LogCenterConstants.DEVICE_TIME_INDEX)));\r
+ super.updateLog(logPack);\r
+ }\r
+\r
public void updateView(DASelectionData data) {\r
+\r
+ RangeView rangeView = (RangeView) getTab(RangeView.ID);\r
+ SnapshotView snapshotView = (SnapshotView) getTab(SnapshotView.ID);\r
+\r
if (ConfigureManager.getInstance()\r
.getValue(ConfigureLabels.RANGEAUTOSELECT)\r
.equals(ConfigureLabels.ON)) {\r
if (TimelineComposite.ID == data.getViewId()) {\r
if (data.getEndTime() - data.getStartTime() >= 1000000) {\r
- setEnableTab(rangeView);\r
- } else {\r
- // do nothing\r
+ setSelectTab(RangeView.ID);\r
}\r
}\r
}\r
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.common.DesignConstants;
-import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackView;
import org.tizen.dynamicanalyzer.ui.info.range.RangeView;
import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineComposite;
public class TimelinePage extends DAPageComposite {
+ public static final String ID = TimelinePage.class.getName();
public final static int TIMELINE_INDEX = 0;
public final static int INFO_INDEX = 1;
public TimelinePage(Composite parent, int style) {
super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_TIMELINE;
this.setLayout(new FillLayout());
leftForm = new SashForm(this, SWT.HORIZONTAL);
{
SnapshotView currentView = new SnapshotView(
tabView.getContentComposite(), SWT.NONE, false);
- tabView.addSnapshotView(currentView,
- InformationViewLabels.SNAPSHOT_VIEW_TITLE);
+ tabView.addView(currentView);
CallstackView callstack = new CallstackView(
tabView.getContentComposite(), SWT.NONE);
- tabView.addView(callstack,
- InformationViewLabels.CALLSTACK_VIEW_TITLE);
+ callstack.setObservingViews(new String[] {CallTraceView.ID});
+ tabView.addView(callstack);
- RangeView stats = new RangeView(tabView.getContentComposite(),
+ RangeView rangeView = new RangeView(tabView.getContentComposite(),
SWT.NONE);
- tabView.addRangeView(stats, InformationViewLabels.RANGE_VIEW_TITLE);
+ tabView.addView(rangeView);
}
// index 2 : APILIST_INDEX
});
}
- public void changeLayout()
- {
-
+ public void changeLayout() {
+
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
}
});
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.logparser.LogPackage;
import org.tizen.dynamicanalyzer.logparser.Logs;
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
tableComp.setColumnVisibility(columnVisibility);
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
}
@Override
}
@Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
- }
-
- @Override
public Control getControl() {
return tableComp;
}
import org.tizen.dynamicanalyzer.model.LogCenter;
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class OpenTraceInputReader implements Runnable {
return;
}
- List<DAPageComposite> pages = AnalyzerManager.getAllPage();
- int size = pages.size();
- for (int i = 0; i < size; i++) {
- pages.get(i).updateLog(logPack);
- }
+ BaseView bv = (BaseView) AnalyzerUtil.getView(BaseView.ID);
+ bv.getMainTab().updateLog(logPack);
}
}
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.communicator.ResourceCommunicator;
+import org.tizen.dynamicanalyzer.handlers.StopHandler;
import org.tizen.dynamicanalyzer.logparser.LogParser;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
AnalyzerLabels.STOP_PROCESS_DLG_SUMMARIZING_DATA);
}
});
+
+ AnalyzerUtil.executeCommand(StopHandler.ID);
}
}
package org.tizen.dynamicanalyzer.ui.toolbar;
-import java.util.ArrayList;
import java.util.List;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.events.ShellListener;
import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.widgets.ComboButtonRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
-import org.tizen.dynamicanalyzer.ui.widgets.TabButtonRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
private List<DACustomButton> pageTab = null;
- private static final int TAB_SIZE = 4;
private static final int TAB_MAIN = 0;
private static final int TAB_ANALYSIS = 1;
private static final int TAB_FILE = 2;
private static final int TIMER_WIDTH = 121;
- private static final int PAGE_BUTTON_WIDTH = 114;
- private static final int PAGE_BUTTON_HEIGHT = 22;
-
private static int COMBO_FIRST_INDEX = 0;
- public static boolean bThreadPageWork = true; // FIXME
- public static boolean bUIPageWork = true; // FIXME
+ 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);
+// Composite lineComposite = new Composite(baseComposite, SWT.NONE);
+// lineComposite.setLayout(new FormLayout());
+// lineComposite.setBackground(ColorResources.BLACK);
- createPageBar(lineComposite);
+// createPageBar(lineComposite);
// Sets layout data.
Control page = configurer.createPageComposite(baseComposite);
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);
+// data.right = new FormAttachment(100, 0);
+// lineComposite.setLayoutData(data);
data = new FormData();
- data.top = new FormAttachment(lineComposite, 0, SWT.BOTTOM);
+ data.top = new FormAttachment(toolbarComposite, 0, SWT.BOTTOM);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
data.bottom = new FormAttachment(100, 0);
.addClickListener(new DACustomButtonClickEventListener() {
@Override
public void handleClickEvent(DACustomButton button) {
- DACustomToggleButton toggle = (DACustomToggleButton) button;
-
- AnalyzerManager.getCurrentPage().setSourceView(
- toggle.isToggled());
-
+
+ // 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);
}
});
}
public void startTraceButton() {
System.out.println("Start trace button clicked");//$NON-NLS-1$
- AnalyzerUtil.changePage(0);
+ AnalyzerUtil.changePage(TimelinePage.ID);
AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
RecordStartStopThread.runStartStopThread();
}
addToolbarListeners();
}
- private void createPageBar(Composite parent) {
- pageTab = new ArrayList<DACustomButton>();
-
- for (int i = 0; i <= TAB_SIZE; i++){
- pageTab.add(new DACustomButton(parent,
- ColorResources.TAB_NORMAL_COLOR_START,
- ColorResources.TAB_NORMAL_COLOR_END,
- ColorResources.TAB_PUSH_COLOR_START,
- ColorResources.TAB_PUSH_COLOR_END,
- ColorResources.TAB_HOVER_COLOR_START,
- ColorResources.TAB_HOVER_COLOR_END,
- ColorResources.TAB_SELECTED_COLOR_START,
- ColorResources.TAB_SELECTED_COLOR_END));
-
-
- pageTab.get(i).setRenderer(new TabButtonRenderer());
- pageTab.get(i).setFontColor(DACustomButton.STATE_NORMAL,
- ColorResources.TAB_NORMAL_FONT_COLOR);
- pageTab.get(i).setFontColor(DACustomButton.STATE_PUSH,
- ColorResources.TAB_PUSH_FONT_COLOR);
- pageTab.get(i).setFontColor(DACustomButton.STATE_HOVER,
- ColorResources.TAB_HOVER_FONT_COLOR);
- pageTab.get(i).setFontColor(DACustomButton.STATE_DISABLE,
- ColorResources.TAB_SELECTED_FONT_COLOR);
- pageTab.get(i).setOutlineColors(
- ColorResources.TAB_OUTLINE_NORMAL_COLOR,
- ColorResources.TAB_OUTLINE_PUSH_COLOR,
- ColorResources.TAB_OUTLINE_HOVER_COLOR,
- ColorResources.TAB_OUTLINE_SELECTED_COLOR);
-
-
- if ( i == TAB_MAIN){
- pageTab.get(i).setEnabled(false);
- pageTab.get(i).setText(AnalyzerLabels.COOLBAR_AREA_TIMELINE);
- }else if ( i == TAB_ANALYSIS){
- pageTab.get(i).setText(AnalyzerLabels.COOLBAR_AREA_SUMMARY);
- }else if ( i == TAB_FILE){
- pageTab.get(i).setText(AnalyzerLabels.COOLBAR_AREA_FILE);
- }else if ( i == TAB_THREAD){
- pageTab.get(i).setText(AnalyzerLabels.COOLBAR_AREA_THREAD);
- }else if ( i == TAB_UI){
- pageTab.get(i).setText(AnalyzerLabels.COOLBAR_AREA_UI);
- }else{
- System.out.print("Tab Count Error - "+ i);
- }
- pageTab.get(i).setFont(FontResources.TAB_BUTTON_FONT);
- }
-
-
- Composite whiteLine = new Composite(parent, SWT.NONE);
- whiteLine.setBackground(ColorResources.WHITE);
- whiteLine.setLayout(new FillLayout());
- whiteLine.addPaintListener(tabCompositePaintListener);
-
- FormData data = new FormData();
- data.left = new FormAttachment(0, 0);
- data.width = PAGE_BUTTON_WIDTH;
- data.height = PAGE_BUTTON_HEIGHT;
- pageTab.get(TAB_MAIN).setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(pageTab.get(TAB_MAIN), 0);
- data.width = PAGE_BUTTON_WIDTH;
- data.height = PAGE_BUTTON_HEIGHT;
- pageTab.get(TAB_ANALYSIS).setLayoutData(data);
-
- data = new FormData();
- data.left = new FormAttachment(pageTab.get(TAB_ANALYSIS), 0);
- data.width = PAGE_BUTTON_WIDTH;
- data.height = PAGE_BUTTON_HEIGHT;
- pageTab.get(TAB_FILE).setLayoutData(data);
-
- // FIXME
- data = new FormData();
- data.left = new FormAttachment(pageTab.get(TAB_FILE), 0);
- if (true == bThreadPageWork) {
- data.width = PAGE_BUTTON_WIDTH;
- data.height = PAGE_BUTTON_HEIGHT;
- } else {
- data.width = 0;
- data.height = 0;
- }
- pageTab.get(TAB_THREAD).setLayoutData(data);
-
- // FIXME
- data = new FormData();
- data.left = new FormAttachment(pageTab.get(TAB_THREAD), 0);
- if (true == bUIPageWork) {
- data.width = PAGE_BUTTON_WIDTH;
- data.height = PAGE_BUTTON_HEIGHT;
- } else {
- data.width = 0;
- data.height = 0;
- }
- pageTab.get(TAB_UI).setLayoutData(data);
-
-
- data = new FormData();
- data.left = new FormAttachment(pageTab.get(TAB_UI), 0);
- data.right = new FormAttachment(100, 0);
- data.bottom = new FormAttachment(100, 0);
- data.top = new FormAttachment(0, 0);
- data.bottom = new FormAttachment(100, 0);
- whiteLine.setLayoutData(data);
- }
// tab, set selection
public void setSelectionTab(int nTab) {
- for (int i = 0; i <= TAB_SIZE; i++) {
+ for (int i = 0; i <= TAB_UI; i++) {
if (i == nTab)
pageTab.get(i).setEnabled(false);
else
initAppCombo();
}
+ // FIXME: rename
public boolean getSourceViewToggleState() {
return viewSourceButton.isToggled();
}
return (index < 0) ? false : true;
}
- private PaintListener tabCompositePaintListener = new PaintListener() {
-
- @Override
- public void paintControl(PaintEvent e) {
- Composite comp = (Composite) e.widget;
- Rectangle rect = comp.getClientArea();
- e.gc.setForeground(ColorResources.TAB_BG_COLOR_START);
- e.gc.setBackground(ColorResources.TAB_BG_COLOR_END);
- e.gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height,
- true);
- e.gc.setForeground(ColorResources.TAB_BG_OUTLINE_COLOR);
- e.gc.drawRectangle(rect);
- }
- };
-
private boolean checkValidApplication() {
List<AppDesktopInfo> apps = DACommunicator.getAppListFromTarget();
if (apps.isEmpty()) {
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
-
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
- }
-
- @Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
}
@Override
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.logparser.LogPackage;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.timeline.DATimelineTabComposite;
-import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
-import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
public class UserInterfacePage extends DAPageComposite {
-
+ public static final String ID = UserInterfacePage.class.getName();
SashForm baseForm;
SashForm upperForm;
SashForm bottomForm;
+ UserInterfacePageDataManager tManager = UserInterfacePageDataManager
+ .getInstance();
- UserInterfacePageDataManager tManager = UserInterfacePageDataManager.getInstance();
-
- public UserInterfacePage(Composite parent, int style) {
+ public UserInterfacePage(Composite parent, int style) {
super(parent, style);
+ name = AnalyzerLabels.COOLBAR_AREA_UI;
this.setLayout(new FillLayout());
System.out.println(" UserInterfacePage");
baseForm.setLayout(new FillLayout());
upperForm = new SashForm(baseForm, SWT.HORIZONTAL);
- UserInterfaceControlListView topLeftFirst = new UserInterfaceControlListView(upperForm,SWT.NONE);
+ UserInterfaceControlListView topLeftFirst = new UserInterfaceControlListView(
+ upperForm, SWT.NONE);
addView(topLeftFirst);
-
- UserInterfaceSceneTransformListView topLeftSecond = new UserInterfaceSceneTransformListView(upperForm, SWT.NONE);
- addView(topLeftSecond);
-
- DATimelineTabComposite topLeftThird = new DATimelineTabComposite(upperForm, SWT.NONE);
+
+ UserInterfaceSceneTransformListView topLeftSecond = new UserInterfaceSceneTransformListView(
+ upperForm, SWT.NONE);
+ addView(topLeftSecond);
+
+ DATimelineTabComposite topLeftThird = new DATimelineTabComposite(
+ upperForm, SWT.NONE);
addView(topLeftThird);
{
- SnapshotView currentView = new SnapshotView(topLeftThird.getContentComposite(), SWT.NONE, false);
- topLeftThird.addSnapshotView(currentView, UserInterfacePageLabels.USERINTERFACE_SNAPSHOT_VIEW_NAME);
+ SnapshotView currentView = new SnapshotView(
+ topLeftThird.getContentComposite(), SWT.NONE, false);
+ topLeftThird.addView(currentView);
}
upperForm.setWeights(new int[] { 35, 35, 30 });
-
+
bottomForm = new SashForm(baseForm, SWT.HORIZONTAL);
- UserInterfaceFunctionProfilingView bottomLeftFirst = new UserInterfaceFunctionProfilingView(bottomForm, SWT.NONE);
+ UserInterfaceFunctionProfilingView bottomLeftFirst = new UserInterfaceFunctionProfilingView(
+ bottomForm, SWT.NONE);
addView(bottomLeftFirst);
-
- UserInterfaceFormBasedLeakListView bottomLeftSecond = new UserInterfaceFormBasedLeakListView(bottomForm, SWT.NONE);
+
+ UserInterfaceFormBasedLeakListView bottomLeftSecond = new UserInterfaceFormBasedLeakListView(
+ bottomForm, SWT.NONE);
addView(bottomLeftSecond);
bottomForm.setWeights(new int[] { 60, 40 });
}
public void updateLog(LogPackage logPack) {
-// System.out.println(" updateLog " + logPack.toString());
tManager.parsePageData(logPack);
}
}
\ No newline at end of file
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.UserInterfacePageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
| SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
tableComp.setColumns(columnNames);
tableComp.setColumnSize(columnSizes);
-
- tableComp.setTableToolTipListener(new TableTooltipListener(tableComp
- .getTable(), false));
- }
-
- @Override
- public void setSourceView(boolean enable) {
- tableComp.setSourceView(enable);
}
@Override
package org.tizen.dynamicanalyzer.ui.widgets;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import org.eclipse.swt.SWT;
private List<DACustomButton> buttons = null;
private List<Composite> children = null;
+ private HashMap<String, Composite> childrenMap = null;
+ private HashMap<String, DACustomButton> buttonMap = null;
+
private Composite tabComposite = null;
private Composite contentsComposite = null;
private StackLayout stackLayout = null;
- public DATabComposite(Composite parent, int style) {
+ private int tabWidth = LONG_TAB_WIDTH;
+
+ public DATabComposite(Composite parent, int style, String ID) {
super(parent, style);
- tabComposite = new Composite(this, SWT.NONE);
+ childrenMap = new HashMap<String, Composite>();
+ buttonMap = new HashMap<String, DACustomButton>();
+
+ tabComposite = new Composite(this, SWT.DOUBLE_BUFFERED);
tabComposite.setLayout(new FormLayout());
- contentsComposite = new Composite(this, SWT.NONE);
+ contentsComposite = new Composite(this, SWT.DOUBLE_BUFFERED);
stackLayout = new StackLayout();
contentsComposite.setLayout(stackLayout);
this.setLayout(new FormLayout());
data.height = DesignConstants.VIEW_TITLEBAR_HEIGHT;
tabComposite.setLayoutData(data);
tabComposite.addPaintListener(tabCompositePaintListener);
- // tabComposite.setBackground(ColorResources.RED);
data = new FormData();
data.top = new FormAttachment(tabComposite, 0);
contentsComposite.setLayoutData(data);
}
- public void addView(Composite child, String title) {
+ public void addView(Composite child) {
if (!(child instanceof ViewAction)) {
return;
}
+
+ String ID = child.getClass().getName();
+ String title = ((ViewAction)child).getViewName();
+
final DACustomButton tabButton = new DACustomButton(tabComposite,
ColorResources.TAB_NORMAL_COLOR_START,
ColorResources.TAB_NORMAL_COLOR_END,
if (getButtons().size() > 0) {
DACustomButton button1 = getButtons().get(getButtons().size() - 1);
data.left = new FormAttachment(button1, 0);
- data.width = SHORT_TAB_WIDTH;
+ data.width = tabWidth; // short
} else {
data.left = new FormAttachment(0, 0);
- data.width = LONG_TAB_WIDTH;
+ data.width = tabWidth; // long
}
tabButton.setLayoutData(data);
+
final Composite tempChild = child;
DACustomButtonClickEventListener buttonListener = new DACustomButtonClickEventListener() {
@Override
public void handleClickEvent(DACustomButton button) {
stackLayout.topControl = tempChild;
- ((ViewAction) tempChild).updateView();
changeButtonLayout(tabButton);
tabComposite.layout();
contentsComposite.layout();
+ ((ViewAction) tempChild).updateView();
}
};
tabButton.addClickListener(buttonListener);
- getButtons().add(tabButton);
+
+ childrenMap.put(ID, child);
+ buttonMap.put(ID, tabButton);
+ getButtons().add(tabButton); // TODO : think about button map??
getTabChildren().add(child);
+
+ // default focus set
if (getTabChildren().size() == 1) {
stackLayout.topControl = child;
contentsComposite.layout();
}
}
+ // dynamic tab size
private void changeButtonLayout(DACustomButton button) {
int size = getButtons().size();
DACustomButton prev = null;
data.left = new FormAttachment(prev, 0);
}
if (sample.equals(button)) {
- data.width = LONG_TAB_WIDTH;
+ data.width = tabWidth; // long
// button.setColor(DACustomButton.STATE_DISABLE,
// ColorResources.CPU_CIRCULAR_GRAPH_COLOR);
button.setGradationColor(DACustomButton.STATE_DISABLE,
// button.setDisableColor(ColorResources.CPU_CIRCULAR_GRAPH_COLOR);
button.setEnabled(false);
} else {
- data.width = SHORT_TAB_WIDTH;
+ data.width = tabWidth; // short
sample.setEnabled(true);
}
prev = sample;
return contentsComposite;
}
- public void setEnableTab(Composite tab) {
- int iButton = -1;
-
- if (null == tab)
+ public void setSelectTab(String ID) {
+ Composite tab = childrenMap.get(ID);
+ DACustomButton button = buttonMap.get(ID);
+ if (null == tab || null == button) {
+ System.out.println("tab createion bug!!"); // for log
return;
-
- for (int i = 0; i < children.size(); i++) {
- if (children.get(i) == tab) {
- iButton = i;
- break;
- }
}
- if (-1 != iButton && null != buttons && iButton < buttons.size()) {
-
- stackLayout.topControl = tab;
- ((ViewAction) tab).updateView();
- contentsComposite.layout();
- changeButtonLayout(buttons.get(iButton));
- }
+ stackLayout.topControl = tab;
+ ((ViewAction) tab).updateView();
+ contentsComposite.layout();
+ changeButtonLayout(button);
}
@Override
@Override
public void updateLog(LogPackage logPack) {
- ((ViewAction) stackLayout.topControl).updateLog(logPack);
+ int size = getTabChildren().size();
+ for (int i = 0; i < size; i++) {
+ ((ViewAction) getTabChildren().get(i)).updateLog(logPack);
+ }
}
@Override
@Override
public void updateView(DASelectionData data) {
- ((ViewAction) stackLayout.topControl).updateView(data);
+ ((ViewAction) getTopComposite()).updateView(data);
}
- @Override
- public void setSourceView(boolean enable) {
- if (null != children && !children.isEmpty()) {
- int size = children.size();
- for (int i = 0; i < size; i++) {
- ((ViewAction) children.get(i)).setSourceView(enable);
- }
- }
+ public Composite getTopComposite() {
+ return (Composite) stackLayout.topControl;
+ }
+
+ public void setTabWidth(int size) {
+ tabWidth = size;
}
private PaintListener tabCompositePaintListener = new PaintListener() {
e.gc.drawRectangle(rect);
}
};
+
+ public Composite getTab(String ID) {
+ return childrenMap.get(ID);
+ }
}
public class FindDialog extends DAMessageBox {
+ private final int ENTER_KEY_CODE = 13;
+
private Text textBox = null;
private DAButton findButton = null;
private DACustomButton forwardButton = null;
@Override
public void handleClickEvent(DACustomButton button) {
findProperty.setLastSearch(textBox.getText());
- if (executeFindCommand()) {
- result = AnalyzerConstants.SUCCESS;
- }
+ executeFindCommand();
}
};
public void keyReleased(KeyEvent e) {
if (null != textBox.getText() && !textBox.getText().isEmpty()) {
findButton.setEnabled(true);
+
+ if (e.keyCode == ENTER_KEY_CODE) {
+ findProperty.setLastSearch(textBox.getText());
+ executeFindCommand();
+ }
} else {
findButton.setEnabled(false);
}
table.setItemHeight(16);
table.addSelectionListener(new SelectionListener() {
-
@Override
public void widgetSelected(SelectionEvent e) {
GridItem[] ti = ((Grid) e.widget).getSelection();
.getShell();
FindDialog dialog = new FindDialog(shell, me);
dialog.open();
- System.out.println("ctrl + f released!!");
- // FIXME: debug
}
}
});
me = this;
+ setTableToolTipListener(new TableTooltipListener(table));
}
public void setTree(boolean tree) {
table.addListener(SWT.MouseDoubleClick, tableListener);
}
+ public void setTableToolTipEnable(boolean enabled) {
+ tableListener.setEnable(enabled);
+ }
+
public void setColumns(String[] columnNames) {
int size = columnNames.length;
for (int i = 0; i < size; i++) {
return selectionIndex;
}
- public void setSourceView(boolean toggle) {
- if (null != tableListener) {
- tableListener.setSourceButtonToggle(toggle);
- }
- }
-
public void clear() {
getSelectionIndex().clear();
getSelections().clear();
if (SWT.CTRL == e.keyCode) {
ctrlPressed = true;
}
+ if (SWT.SPACE == e.keyCode) {
+ System.out.println("space pressed");
+ }
}
});
me = this;
+ setTableToolTipListener(new TableTooltipListener(tree));
}
public void setTree(boolean tree) {
tree.addListener(SWT.MouseDoubleClick, tableListener);
}
+ public void setTableToolTipEnable(boolean enabled) {
+ tableListener.setEnable(enabled);
+ }
+
public void setColumns(String[] columnNames) {
int size = columnNames.length;
for (int i = 0; i < size; i++) {
List<TreeInput> input = makeTreeInput();
createTree(input, tree);
-// tree.setSelection(sels);
- tree.select(sels);
-// setSelections();
+ // tree.setSelection(sels);
+ tree.select(sels);
+ // setSelections();
}
-// private void setSelections() {
-// if (tree.isFocusControl()) {
-// GridItem[] items = tree.getItems();
-// List<String> selList = getSelList();
-// int size = items.length;
-// int selSize = selList.size();
-//
-// for (int i = 0; i < size; i++) {
-// DATableDataFormat tableData = (DATableDataFormat) items[i]
-// .getData();
-// String key = tableData.getSelectionKey();
-//
-// for (int ii = 0; ii < selSize; ii++) {
-// if (key.equals(selList.get(ii))) {
-// System.out.println("selection " + i + " key " + key);
-// tree.setSelection(i);
-// }
-// }
-// }
-// }
-// }
+ // private void setSelections() {
+ // if (tree.isFocusControl()) {
+ // GridItem[] items = tree.getItems();
+ // List<String> selList = getSelList();
+ // int size = items.length;
+ // int selSize = selList.size();
+ //
+ // for (int i = 0; i < size; i++) {
+ // DATableDataFormat tableData = (DATableDataFormat) items[i]
+ // .getData();
+ // String key = tableData.getSelectionKey();
+ //
+ // for (int ii = 0; ii < selSize; ii++) {
+ // if (key.equals(selList.get(ii))) {
+ // System.out.println("selection " + i + " key " + key);
+ // tree.setSelection(i);
+ // }
+ // }
+ // }
+ // }
+ // }
public abstract List<TreeInput> makeTreeInput();
return itemCount;
}
- public void setSourceView(boolean toggle) {
- if (null != tableListener) {
- tableListener.setSourceButtonToggle(toggle);
- }
- }
-
public void clear() {
tree.removeAll();
getSelectionIndex().clear();
tree.getVerticalBar().setSelection(
getScrollSelectionIndex(i));
System.out.println("select : " + i);
-// tree.setSelection(i);
- tree.select(i);
+ // tree.setSelection(i);
+ tree.select(i);
System.out.println(tree.getSelectionIndex());
updateTree();
return i;
tree.getVerticalBar().setSelection(
getScrollSelectionIndex(i));
System.out.println("select : " + i);
-// tree.setSelection(i);
- tree.select(i);
+ // tree.setSelection(i);
+ tree.select(i);
System.out.println(tree.getSelectionIndex());
updateTree();
return i;
table.setEmptyColumnHeaderRenderer(new DATableEmptyColumnHeaderRenderer());
table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
- tableListener = new TableTooltipListener(table, false);
setTableToolTipListener(tableListener);
table.setItemHeight(16);
return itemCount;
}
- public void setSourceView(boolean toggle) {
- tableListener.setSourceButtonToggle(toggle);
- }
-
private SelectionListener scrollbarSelectionListener = new SelectionListener() {
@Override
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.ScrollBar;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
import org.tizen.dynamicanalyzer.model.LogCenter;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.sql.SqlManager;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.Formatter;
protected int itemCount = 0;
protected int type = 0;
protected List<Integer> columnSize;
- private TableTooltipListener tableListener;
+// private TableTooltipListener tableListener;
protected HashMap<String, String> selection;
protected List<Integer> selectionIndex;
initTable();
}
- public void enableViewSource() {
- tableListener.setSourceButtonToggle(true);
-
- Cursor cursor = new Cursor(null,
- ImageResources.VIEW_SOURCE_CURSOR.getImageData(), 0, 0);
- table.setCursor(cursor);
- cursor.dispose();
- }
-
- public void disableViewSource() {
- tableListener.setSourceButtonToggle(false);
-
- Cursor cursor = new Cursor(null, SWT.CURSOR_ARROW);
- table.setCursor(cursor);
- cursor.dispose();
- }
-
private void initBaseComposite() {
comp = new Composite(this, SWT.V_SCROLL);
comp.setBackground(ColorResources.WHITE);
});
// Creates table listener.
- tableListener = new TableTooltipListener(table, false);
- // Adds table listener.
- table.addListener(SWT.Dispose, tableListener);
- table.addListener(SWT.KeyDown, tableListener);
- table.addListener(SWT.KeyUp, tableListener);
- table.addListener(SWT.MouseEnter, tableListener);
- table.addListener(SWT.MouseExit, tableListener);
- table.addListener(SWT.MouseMove, tableListener);
- table.addListener(SWT.MouseHover, tableListener);
- table.addListener(SWT.MouseDoubleClick, tableListener);
+// tableListener = new TableTooltipListener(table, false);
+// // Adds table listener.
+// table.addListener(SWT.Dispose, tableListener);
+// table.addListener(SWT.KeyDown, tableListener);
+// table.addListener(SWT.KeyUp, tableListener);
+// table.addListener(SWT.MouseEnter, tableListener);
+// table.addListener(SWT.MouseExit, tableListener);
+// table.addListener(SWT.MouseMove, tableListener);
+// table.addListener(SWT.MouseHover, tableListener);
+// table.addListener(SWT.MouseDoubleClick, tableListener);
table.setItemHeight(AnalyzerUtil.getTableItemHeight(table));
}
import org.tizen.dynamicanalyzer.common.CommonConstants;
import org.tizen.dynamicanalyzer.handlers.RealtimePerspectiveHandler;
import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
-import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
import org.tizen.dynamicanalyzer.ui.file.chart.FileChartManager;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
-import org.tizen.dynamicanalyzer.ui.page.DAEffectFrame;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineComposite;
-import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
public class AnalyzerUtil {
private static IWorkbenchWindow window = null;
}
/** stop trace -> change page to summary **/
- public static void changePage(final int nPage) {
+ public static void changePage(final String pageId) {
final BaseView baseView = (BaseView) AnalyzerUtil.getView(BaseView.ID);
- final DAEffectFrame mainView = baseView.getMainView();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
- mainView.setTopComposite(nPage);
- ToolbarArea.getInstance().setSelectionTab(nPage);
+ DATabComposite tabView = baseView.getMainTab();
+ tabView.setSelectTab(pageId);
}
});
}
-
- public static List<String> difference(ArrayList<String> base, ArrayList<String> target)
- {
- @SuppressWarnings("unchecked")
- ArrayList<String> result = (ArrayList<String>) base.clone();
- result.removeAll(target);
- return result;
- }
-
- public static List<TableInput> differenceDepth2(ArrayList<TableInput> base, ArrayList<TableInput> target)
- {
- @SuppressWarnings("unchecked")
- ArrayList<TableInput> result = (ArrayList<TableInput>) base.clone();
- result.removeAll(target);
- return result;
- }
+
}