protected void setInterval(int interval) {
this.interval = interval;
}
+
+ public ScrollBar getHScrollBar() {
+ return hScroll;
+ }
}
public class GLPageLabels extends NLS {
private static final String BUNDLE_NAME = "org.tizen.dynamicanalyzer.nl.GLPageLabels"; //$NON-NLS-1$
- public static String GL_CHART_TITLE_TIME;
- public static String GL_CHART_TITLE_FRAME;
+ public static String GL_CHART_TITLE_FRAME_RATE;
+ public static String GL_CHART_TITLE_FRAME_TIME;
public static String GL_DETAILS_VIEW_TITLE;
-GL_CHART_TITLE_TIME=Time
-GL_CHART_TITLE_FRAME=Frame
+GL_CHART_TITLE_FRAME_RATE=Frame Rate
+GL_CHART_TITLE_FRAME_TIME=Frame Time
GL_DETAILS_VIEW_TITLE=Details
import org.eclipse.swt.widgets.Canvas;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DASelectionData;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlotIntervalMarker;
return;
}
+
+ DATabComposite timelineTabComp = (DATabComposite) AnalyzerUtil
+ .getView(TimelinePage.ID, DATabComposite.ID);
+ SnapshotView snapshotView = (SnapshotView) timelineTabComp
+ .getTab(SnapshotView.ID);
+ snapshotView.setLatestButtonEnable(true);
+
boolean bShift = false;
if ((e.stateMask & SWT.SHIFT) != 0) {
bShift = true;
import org.tizen.dynamicanalyzer.swap.model.data.SystemData;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.page.ViewAction;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
public void handleClickEvent(DACustomButton button) {
setLatestButtonEnable(false);
setSelectTime(lastStartTime);
+
+ DASelectionData selData = new DASelectionData(ID, ToolbarArea
+ .getInstance().getTime(), ToolbarArea.getInstance()
+ .getTime(), null, latestButton);
+ AnalyzerManager.getCurrentPage().updatePage(selData);
+
updateView();
}
});
setLatestButtonEnable(true);
long selStartTime = selData.getStartTime();
if (selData.getViewId().equals(SnapshotView.ID)) {
+ if(selData.getControl() == latestButton) {
+ setLatestButtonEnable(false);
+ }
if (selStartTime < 0) {
selStartTime = 0;
}
latestButton.setButtonEnabled(false);
}
}
+
+ public boolean isLatestButtonEnabled() {
+ return latestButton.isButtonEnabled();
+ }
}
import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
-import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonRenderer;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
contents.setLayout(stackLayout);
frameChartBoard = new DAChartBoard(contents,
- GLPageLabels.GL_CHART_TITLE_FRAME, DAChartBoard.BOARD_STYLE_FRAME);
+ GLPageLabels.GL_CHART_TITLE_FRAME_TIME, DAChartBoard.BOARD_STYLE_FRAME);
frameChartBoard.setNameFont(FontResources.CHART_NAME_FONT);
timeChartBoard = new DAChartBoard(contents,
- GLPageLabels.GL_CHART_TITLE_TIME, DAChartBoard.BOARD_STYLE_TIME);
+ GLPageLabels.GL_CHART_TITLE_FRAME_RATE, DAChartBoard.BOARD_STYLE_TIME);
timeChartBoard.setNameFont(FontResources.CHART_NAME_FONT);
stackLayout.topControl = frameChartBoard;
ImageResources.TIMELINE_DROPDOWN_HOVER,
ImageResources.TIMELINE_DROPDOWN_PUSH,
ImageResources.TIMELINE_DROPDOWN_NORMAL);
- frameCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME);
- frameCombo.add(GLPageLabels.GL_CHART_TITLE_TIME);
+ frameCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME);
+ frameCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE);
frameCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
frameCombo.select(0);
frameCombo.setComboButtonGradation(
ImageResources.COMBO_DROPDOWN_DOWN);
frameCombo.setEnabled(true);
frameCombo.setItemHeight(COMBO_HEIGHT);
- frameCombo.setComboRender(new TitleComboRenderer());
+ frameCombo.setComboRender(new GLTitleComboRenderer());
frameCombo.setComboPopupRender(new TitleComboPopupRenderer());
frameCombo.setButtonRenderer(new DACustomButtonRenderer());
frameCombo.addSelectionListener(new DACustomComboSelectionListener() {
return;
}
if (selected
- .equals(GLPageLabels.GL_CHART_TITLE_TIME)) {
+ .equals(GLPageLabels.GL_CHART_TITLE_FRAME_RATE)) {
changeComboFrameToTime();
} else {
return;
ImageResources.TIMELINE_DROPDOWN_HOVER,
ImageResources.TIMELINE_DROPDOWN_PUSH,
ImageResources.TIMELINE_DROPDOWN_NORMAL);
- timeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME);
- timeCombo.add(GLPageLabels.GL_CHART_TITLE_TIME);
+ timeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_TIME);
+ timeCombo.add(GLPageLabels.GL_CHART_TITLE_FRAME_RATE);
timeCombo.setTextAlign(DACustomCombo.TEXT_ALIGN_CENTER);
timeCombo.select(1);
timeCombo.setComboButtonGradation(
ImageResources.COMBO_DROPDOWN_DOWN);
timeCombo.setEnabled(true);
timeCombo.setItemHeight(COMBO_HEIGHT);
- timeCombo.setComboRender(new TitleComboRenderer());
+ timeCombo.setComboRender(new GLTitleComboRenderer());
timeCombo.setComboPopupRender(new TitleComboPopupRenderer());
timeCombo.setButtonRenderer(new DACustomButtonRenderer());
timeCombo.addSelectionListener(new DACustomComboSelectionListener() {
return;
}
if (selected
- .equals(GLPageLabels.GL_CHART_TITLE_FRAME)) {
+ .equals(GLPageLabels.GL_CHART_TITLE_FRAME_TIME)) {
changeComboTimeToFrame();
} else {
return;
private void changeComboFrameToTime() {
stackLayout.topControl = timeChartBoard;
contents.layout();
- timeCombo.setText(GLPageLabels.GL_CHART_TITLE_TIME);
+ timeCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_RATE);
timeChartBoard.setScaleVal(frameChartBoard.getScaleVal());
timeChartBoard.setVisibleStart(frameChartBoard.getVisibleStart());
timeChartBoard.setItemsHeightMode(frameChartBoard.isItemMinimized());
private void changeComboTimeToFrame() {
stackLayout.topControl = frameChartBoard;
contents.layout();
- frameCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME);
+ frameCombo.setText(GLPageLabels.GL_CHART_TITLE_FRAME_TIME);
frameChartBoard.setScaleVal(timeChartBoard.getScaleVal());
frameChartBoard.setVisibleStart(timeChartBoard.getVisibleStart());
frameChartBoard.setItemsHeightMode(timeChartBoard.isItemMinimized());
private void initializeCharts() {
initIntervalMarkers(frameChartBoard);
-// GLFPSChart fpsChart = GLFPSChart.getInstance();
-// DAChartBoardItem fpsChartItem = fpsChart.createBoardItem(frameChartBoard);
-// DAChart fpsChartWidget = fpsChartItem.getChart();
-//
-// GLFrameChartMouseEventListener glFrameChartMouseEventListener = new GLFrameChartMouseEventListener(
-// fpsChart.getPopupMenu(), frameChartBoard.getTimeline());
-//
-// fpsChartWidget.getPlot().setMarkers(frameChartBoard.getMarkers());
-// fpsChartWidget.addMouseListener(glFrameChartMouseEventListener);
-// fpsChartWidget.addMouseMoveListener(glFrameChartMouseEventListener);
-// fpsChartWidget.addMouseTrackListener(new TimelineChartMouseTrackAdapter(
-// frameChartBoard.getTimeline()));
-//
-// BoundLineEventListener underBoundLineEventListener = new BoundLineEventListener(fpsChartWidget, DAChartPlot.BoundType.UNDER);
-// fpsChartWidget.addMouseListener(underBoundLineEventListener);
-// fpsChartWidget.addMouseMoveListener(underBoundLineEventListener);
-// fpsChartWidget.addMouseTrackListener(underBoundLineEventListener);
-
GLFrameTimeChart frameTimeChart = GLFrameTimeChart.getInstance();
DAChartBoardItem frameTimeChartItem = frameTimeChart.createBoardItem(frameChartBoard);
DAChart frameTimeChartWidget = frameTimeChartItem.getChart();
--- /dev/null
+package org.tizen.dynamicanalyzer.ui.opengl.ui.chart;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
+import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
+
+public class GLTitleComboRenderer extends TitleComboRenderer {
+ @Override
+ public void drawImage(GC gc, Canvas canvas, Image image, String text,
+ int textAlign, Font font, int state) {
+ Rectangle rect = canvas.getClientArea();
+ gc.drawImage(image, rect.x, rect.y);
+ if (null == font) {
+ gc.setFont(FontResources.COMBO);
+ } else {
+ gc.setFont(font);
+ }
+ gc.setForeground(ColorResources.DEVICE_APPLICATION_ENABLE);
+ Point p = gc.textExtent(text, SWT.DRAW_MNEMONIC);
+ int textX = 0;
+ if (textAlign == DACustomCombo.TEXT_ALIGN_LEFT) {
+ textX = 5;
+ } else if (textAlign == DACustomCombo.TEXT_ALIGN_RIGHT) {
+ textX = rect.width - p.x;
+ } else {
+ textX = (rect.width / 2) - (p.x / 2);
+ }
+ gc.drawString(text, textX, (rect.height - p.y) / 2, true);
+ Rectangle clipping = new Rectangle(rect.x + rect.width - 17, rect.y, 0,
+ rect.height);
+ gc.setClipping(clipping);
+ gc.drawImage(image, rect.x, rect.y);
+ }
+}
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.listeners.TableTooltipListener;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.nl.GLPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
ColorResources.SERIES_COLOR_CPU_SYSTEM);
newSeries.addSeriesItem(new DAChartSeriesItem(time, load,
Formatter.toPercentageFormat(load)));
+ //FIXME debut
+ try{
childItem.getChart().addSeries(newSeries);
+ } catch(NullPointerException e) {
+ e.printStackTrace();
+ }
childSeriesMap.put(pid, newSeries);
}
import java.util.List;
import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.ScrollBar;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.model.DAView;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
import org.tizen.dynamicanalyzer.ui.common.UICommonConstants;
+import org.tizen.dynamicanalyzer.ui.info.snapshot.SnapshotView;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
import org.tizen.dynamicanalyzer.ui.timeline.chart.CPUChart;
import org.tizen.dynamicanalyzer.ui.timeline.chart.HeapChart;
import org.tizen.dynamicanalyzer.ui.timeline.chart.ScreenshotChart;
import org.tizen.dynamicanalyzer.ui.timeline.logparser.DeviceLogParser;
import org.tizen.dynamicanalyzer.ui.timeline.logparser.LifecycleLogParser;
import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
+import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
chartBoard.setNameFont(FontResources.CHART_NAME_FONT);
timelineChartManager.setChartTimelineChartBoard(chartBoard);
chartBoard.setSelectable(false);
+
+ ScrollBar hScrollBar = chartBoard.getHScrollBar();
+ hScrollBar.addSelectionListener(new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ DATabComposite timelineTabComp = (DATabComposite) AnalyzerUtil
+ .getView(TimelinePage.ID, DATabComposite.ID);
+ SnapshotView snapshotView = (SnapshotView) timelineTabComp
+ .getTab(SnapshotView.ID);
+ snapshotView.setLatestButtonEnable(true);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
StackLayout stackLayout = new StackLayout();
stackLayout.topControl = chartBoard;
long start = selData.getStartTime();
long end = selData.getEndTime();
- Double startTime = (double) start / TimelineConstants.MEGA_DOUBLE;
- Double endTime = (double) end / TimelineConstants.MEGA_DOUBLE;
+ Double startTime = start / TimelineConstants.MEGA_DOUBLE;
+ Double endTime = end / TimelineConstants.MEGA_DOUBLE;
double middleTime = (startTime + endTime) / 2.0;
if (startTime.equals(endTime)) {
middleTime = startTime;
return;
}
+ DATabComposite timelineTabComp = (DATabComposite) AnalyzerUtil
+ .getView(TimelinePage.ID, DATabComposite.ID);
+ SnapshotView snapshotView = (SnapshotView) timelineTabComp
+ .getTab(SnapshotView.ID);
+ if (snapshotView != null && !snapshotView.isLatestButtonEnabled()) {
+ DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) chartBoard
+ .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
+
+ double time = ToolbarArea.getInstance().getTime()
+ / TimelineConstants.MEGA_DOUBLE;
+ intervalMarker.setStartVal(time);
+ intervalMarker.setEndVal(time);
+ }
+
timelineChartManager.addNewCustomChart();
chartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());