[Title] Fix abnormal operation between gl page views
authorkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Mon, 6 Jan 2014 02:28:39 +0000 (11:28 +0900)
committerkamuru <kamuru@kamuru-Samsung-Desktop-System.(none)>
Mon, 6 Jan 2014 02:28:39 +0000 (11:28 +0900)
[Desc.] Fix gl page view selection operation fault
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java

index 1e6efda..2b8f3e2 100755 (executable)
@@ -955,7 +955,6 @@ public class Communicator30 extends BaseCommunicator {
                                libInst = ByteUtils.getByte(libInst, functionInstList.get(i)
                                                .getByteValue());
                        }
-                       System.out.println("debug");
                }
                count = count - failedCount;
                libInst = ByteUtils.getByte(count, libInst);
index 68ae3e4..649927c 100644 (file)
@@ -86,34 +86,32 @@ public class BoundLineEventListener implements MouseListener, MouseMoveListener,
                                        drawBoundLine(e.gc, LINE_COLOR, boundLineWidth, boundValue);
 
                                        // draw bound value
-                                       if (pointSize == POINT_MAX_SIZE) {
+                                       if (pointSize == POINT_MAX_SIZE
+                                                       && boundLineWidth == LINE_MAX_WIDTH) {
                                                int chartHeight = chart.getBounds().height;
 
-                                               if (boundLineWidth == LINE_MAX_WIDTH) {
-                                                       String boundText = String.valueOf(boundValue)
-                                                                       + plot.getAxisUnit();
-                                                       chart.redrawForce();
-                                                       int boundTextHeight = e.gc.textExtent(boundText).y;
-                                                       int boundTextPosition;
-
-                                                       double linePosition = 1.0 - (boundValue / max);
-                                                       if (chartHeight * linePosition > chartHeight
-                                                                       - boundTextHeight) {
-                                                               boundTextPosition = (int) Math
-                                                                               .round(chartHeight * linePosition
-                                                                                               - boundTextHeight);
-                                                       } else {
-                                                               boundTextPosition = (int) Math
-                                                                               .round(chartHeight * linePosition);
-                                                       }
+                                               String boundText = String.valueOf(boundValue)
+                                                               + plot.getAxisUnit();
+//                                             chart.redrawForce();
+                                               int boundTextHeight = e.gc.textExtent(boundText).y;
+                                               int boundTextPosition;
+
+                                               double linePosition = 1.0 - (boundValue / max);
+                                               if (chartHeight * linePosition > chartHeight
+                                                               - boundTextHeight) {
+                                                       boundTextPosition = (int) Math.round(chartHeight
+                                                                       * linePosition - boundTextHeight);
+                                               } else {
+                                                       boundTextPosition = (int) Math.round(chartHeight
+                                                                       * linePosition);
+                                               }
 
-                                                       e.gc.setForeground(LINE_COLOR);
-                                                       if (boundTextPosition > 0) {
-                                                               e.gc.drawString(boundText, 0,
-                                                                               boundTextPosition, true);
-                                                       } else {
-                                                               e.gc.drawString("^" + boundText, 0, 0, true);
-                                                       }
+                                               e.gc.setForeground(LINE_COLOR);
+                                               if (boundTextPosition > 0) {
+                                                       e.gc.drawString(boundText, 0, boundTextPosition,
+                                                                       true);
+                                               } else {
+                                                       e.gc.drawString("^" + boundText, 0, 0, true);
                                                }
                                        }
                                } // end of !isExpanded
index 7d74c0b..898c7a0 100644 (file)
@@ -60,10 +60,10 @@ import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.utils.Formatter;
-import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 
 public class GLAPIListTable extends DAApiListTableComposite {
-       private static String EMPTY = "";
+       public static final String ID = GLAPIListTable.class.getName();
+       private static final String EMPTY = "";
        private String[] columnNames = { GLPageLabels.GL_API_LIST_VIEW_SEQ, EMPTY,
                        GLPageLabels.GL_API_LIST_VIEW_TIME,
                        GLPageLabels.GL_API_LIST_VIEW_NAME,
@@ -146,7 +146,7 @@ public class GLAPIListTable extends DAApiListTableComposite {
                DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData();
                long time = dataFormat.getLogData().getTime();
 
-               GLSelectionData selData = new GLSelectionData(GLAPIListView.ID, time,
+               GLSelectionData selData = new GLSelectionData(GLAPIListTable.ID, time,
                                time, items, table, startFrameIndex, -1);
                AnalyzerManager.getCurrentPage().updatePage(selData);
                AnalyzerManager.getCurrentPage().controlSelection(GLAPIListView.ID);
@@ -170,7 +170,7 @@ public class GLAPIListTable extends DAApiListTableComposite {
                DATableDataFormat dataFormat = (DATableDataFormat) items[0].getData();
                long time = dataFormat.getLogData().getTime();
 
-               GLSelectionData selData = new GLSelectionData(GLAPIListView.ID, time,
+               GLSelectionData selData = new GLSelectionData(GLAPIListTable.ID, time,
                                time, items, table, startFrameIndex, -1);
                AnalyzerManager.getCurrentPage().updatePage(selData);
                AnalyzerManager.getCurrentPage().controlSelection(GLAPIListView.ID);
index 38d36bd..f2851b8 100644 (file)
@@ -229,7 +229,7 @@ public class GLChartView extends DAView {
 
        @Override
        public void updateView() {
-               frameChartBoard.setTotalEndTime(GLDataMaker.getInstance().getFrameSize()
+               frameChartBoard.setTotalEndTime(glDataMaker.getFrameSize()
                                * TimelineConstants.MEGA_LONG);
                timeChartBoard.setTotalEndTime(ToolbarArea.getInstance().getTime());
 
@@ -274,15 +274,24 @@ public class GLChartView extends DAView {
                if (id.equals(GLAPIListView.ID)) {
                        int frameIndex = ((GLSelectionData) data).getFrameIndex();
 
+                       frameChartBoard.setVisibleMiddleTime(frameIndex);
                        DAChartPlotIntervalMarker intervalMarker = (DAChartPlotIntervalMarker) frameChartBoard
                                        .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
                        intervalMarker.setInterval(frameIndex, frameIndex);
 
+                       long start = data.getStartTime();
+                       long end = data.getEndTime();
+                       Double startTime = start / TimelineConstants.MEGA_DOUBLE;
+                       Double endTime = end / TimelineConstants.MEGA_DOUBLE;
+                       double middleTime = (startTime + endTime) / 2.0;
+                       if (startTime.equals(endTime)) {
+                               middleTime = startTime;
+                       }
+                       
+                       timeChartBoard.setVisibleMiddleTime(middleTime);
                        intervalMarker = (DAChartPlotIntervalMarker) timeChartBoard
                                        .getMarkers().get(UICommonConstants.SELECTION_MARKER_INDEX);
-                       intervalMarker.setInterval(
-                                       glDataMaker.getFrameCountListIndex(frameIndex),
-                                       glDataMaker.getFrameCountListIndex(frameIndex));
+                       intervalMarker.setInterval(startTime, endTime);
                }
        }
 
index 751d7ed..5217ab7 100644 (file)
@@ -37,6 +37,7 @@ import org.tizen.dynamicanalyzer.nl.GLPageLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.opengl.data.GLSelectionData;
+import org.tizen.dynamicanalyzer.ui.opengl.ui.apiList.GLAPIListTable;
 import org.tizen.dynamicanalyzer.ui.opengl.ui.apiList.GLAPIListView;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
@@ -50,9 +51,9 @@ public class GLContextView extends DAView {
        private int[] innerMaxWeight = { 0, 100 };
        private int[] outerMaxWeight = { 100, 0 };
        private int[] bottomMaxWeight = { 0, 100 };
-       
+
        private int[] oldBottomLayout = null;
-       
+
        public GLContextView(Composite parent, int style) {
                super(parent, style);
                setLayout(new FillLayout());
@@ -75,32 +76,33 @@ public class GLContextView extends DAView {
        @Override
        public void updateView(DASelectionData data) {
                String id = data.getViewId();
-               if (id.equals(GLAPIListView.ID) && data instanceof GLSelectionData) {
+               if ((id.equals(GLAPIListView.ID) && data instanceof GLSelectionData)
+                               || id.equals(GLAPIListTable.ID)) {
                        GridItem[] gridItems = (GridItem[]) data.getData();
                        DATableDataFormat tableDataFormat = (DATableDataFormat) gridItems[0]
                                        .getData();
                        LogData logData = tableDataFormat.getLogData();
 
-                       int frameIndex = ((GLSelectionData)data).getFrameIndex();
+                       int frameIndex = ((GLSelectionData) data).getFrameIndex();
                        String seq = Integer.toString(logData.getSeq());
                        glContextTreeTable.updateTree(seq);
-                       
+
                        viewContainer.setTitleText(GLPageLabels.GL_CONTEXT_VIEW_TITLE + "("
                                        + frameIndex + "frame #" + seq + ")");
                }
        }
-       
+
        @Override
        public void clear() {
                glContextTreeTable.clear();
                viewContainer.setTitleText(GLPageLabels.GL_CONTEXT_VIEW_TITLE);
        }
-       
+
        @Override
        public void otherViewSelectionOccured() {
                glContextTreeTable.deselectAll();
        }
-       
+
        @Override
        public void setMaxSize(boolean maximized) {