From 807434d3fb9fba7a26625b057343e8f9d01fbf0c Mon Sep 17 00:00:00 2001 From: kamuru Date: Mon, 6 Jan 2014 11:28:39 +0900 Subject: [PATCH] [Title] Fix abnormal operation between gl page views [Desc.] Fix gl page view selection operation fault [Issue] --- .../swap/communicator/Communicator30.java | 1 - .../eventListner/BoundLineEventListener.java | 48 +++++++++++----------- .../ui/opengl/ui/apiList/GLAPIListTable.java | 8 ++-- .../ui/opengl/ui/chart/GLChartView.java | 17 ++++++-- .../ui/opengl/ui/context/GLContextView.java | 18 ++++---- 5 files changed, 50 insertions(+), 42 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java index 1e6efda..2b8f3e2 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java @@ -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); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java index 68ae3e4..649927c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/eventListner/BoundLineEventListener.java @@ -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 diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java index 7d74c0b..898c7a0 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java @@ -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); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java index 38d36bd..f2851b8 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/chart/GLChartView.java @@ -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); } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java index 751d7ed..5217ab7 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/context/GLContextView.java @@ -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) { -- 2.7.4