Merge branch 'release/2.15.0'
This commit is contained in:
commit
4c48fda5ad
|
@ -12,7 +12,8 @@
|
||||||
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
|
<booleanAttribute key="M2_UPDATE_SNAPSHOTS" value="false"/>
|
||||||
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
<stringAttribute key="M2_USER_SETTINGS" value=""/>
|
||||||
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
|
<booleanAttribute key="M2_WORKSPACE_RESOLUTION" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
|
||||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/AdoptOpenJDK 8 [1.8.0_232]"/>
|
|
||||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
|
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${project_loc:com.minres.scviewer.parent}"/>
|
||||||
</launchConfiguration>
|
</launchConfiguration>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>3.0.0-SNAPSHOT</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>4.0.0-SNAPSHOT</version>
|
<version>4.0.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -79,23 +79,17 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
|
||||||
|
|
||||||
public void setHighliteRelation(RelationType relationType);
|
public void setHighliteRelation(RelationType relationType);
|
||||||
|
|
||||||
public long getMaxTime();
|
|
||||||
|
|
||||||
public void setMaxTime(long maxTime);
|
public void setMaxTime(long maxTime);
|
||||||
|
|
||||||
public void setZoomLevel(int scale);
|
|
||||||
|
|
||||||
public int getZoomLevel();
|
|
||||||
|
|
||||||
public void setCursorTime(long time);
|
public void setCursorTime(long time);
|
||||||
|
|
||||||
public void setMarkerTime(long time, int index);
|
public void setMarkerTime(int marker, long time);
|
||||||
|
|
||||||
public long getCursorTime();
|
public long getCursorTime();
|
||||||
|
|
||||||
public int getSelectedMarkerId();
|
public int getSelectedMarker();
|
||||||
|
|
||||||
public long getMarkerTime(int index);
|
public long getMarkerTime(int marker);
|
||||||
|
|
||||||
public void addPropertyChangeListener(PropertyChangeListener listener);
|
public void addPropertyChangeListener(PropertyChangeListener listener);
|
||||||
|
|
||||||
|
@ -105,16 +99,8 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
|
||||||
|
|
||||||
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
|
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
|
||||||
|
|
||||||
public String getScaledTime(long time);
|
|
||||||
|
|
||||||
public String[] getZoomLevels();
|
|
||||||
|
|
||||||
public List<ICursor> getCursorList();
|
public List<ICursor> getCursorList();
|
||||||
|
|
||||||
public long getBaselineTime();
|
|
||||||
|
|
||||||
public void setBaselineTime(Long scale);
|
|
||||||
|
|
||||||
public void scrollHorizontal(int percent);
|
public void scrollHorizontal(int percent);
|
||||||
|
|
||||||
public void scrollTo(int pos);
|
public void scrollTo(int pos);
|
||||||
|
@ -124,4 +110,7 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
|
||||||
public void deleteSelectedTracks();
|
public void deleteSelectedTracks();
|
||||||
|
|
||||||
public TrackEntry addWaveform(IWaveform waveform, int pos);
|
public TrackEntry addWaveform(IWaveform waveform, int pos);
|
||||||
|
|
||||||
|
public IWaveformZoom getWaveformZoom();
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.minres.scviewer.database.ui;
|
||||||
|
|
||||||
|
public interface IWaveformZoom {
|
||||||
|
|
||||||
|
long getMaxVisibleTime();
|
||||||
|
|
||||||
|
long getMinVisibleTime();
|
||||||
|
|
||||||
|
void setMinVisibleTime(long scale);
|
||||||
|
|
||||||
|
long getMaxTime();
|
||||||
|
|
||||||
|
long getScale();
|
||||||
|
|
||||||
|
void setScale(long factor);
|
||||||
|
|
||||||
|
void setVisibleRange(long startTime, long endTime);
|
||||||
|
|
||||||
|
void centerAt(long time);
|
||||||
|
|
||||||
|
void zoom(ZoomKind kind);
|
||||||
|
|
||||||
|
String timeToString(long time);
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
package com.minres.scviewer.database.ui;
|
||||||
|
|
||||||
|
public enum ZoomKind {IN, OUT, FIT, FULL}
|
|
@ -4,8 +4,8 @@ import java.text.DecimalFormat;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
||||||
public static final String[] UNIT_STRING={"fs", "ps", "ns", "us", "ms"};//, "s"};
|
public static final String[] UNIT_STRING={"fs", "ps", "ns", "us", "ms", "s"};
|
||||||
public static final long[] UNIT_MULTIPLIER={1, 1000, 1000*1000, 1000*1000*1000, 1000*1000*1000*1000, 1000*1000*1000*1000*1000 };
|
public static final long[] UNIT_MULTIPLIER={1l, 1000l, 1000l*1000, 1000l*1000*1000, 1000l*1000*1000*1000, 1000l*1000*1000*1000*1000 };
|
||||||
|
|
||||||
//public static final int[] UNIT_MULTIPLIER={1, 3, 10, 30, 100, 300};
|
//public static final int[] UNIT_MULTIPLIER={1, 3, 10, 30, 100, 300};
|
||||||
public static final long[] SCALE_MULTIPLIER={1, 2, 5, 10, 20, 50, 100, 200, 500};
|
public static final long[] SCALE_MULTIPLIER={1, 2, 5, 10, 20, 50, 100, 200, 500};
|
||||||
|
@ -16,19 +16,32 @@ public class Constants {
|
||||||
public static final DecimalFormat TIME_FORMAT_FS = new DecimalFormat("#");
|
public static final DecimalFormat TIME_FORMAT_FS = new DecimalFormat("#");
|
||||||
public static final DecimalFormat TIME_FORMAT_PS = new DecimalFormat("#");
|
public static final DecimalFormat TIME_FORMAT_PS = new DecimalFormat("#");
|
||||||
public static final DecimalFormat TIME_FORMAT_NS = new DecimalFormat("#.0##");
|
public static final DecimalFormat TIME_FORMAT_NS = new DecimalFormat("#.0##");
|
||||||
public static final DecimalFormat TIME_FORMAT_US = new DecimalFormat("#.0#####");
|
public static final DecimalFormat TIME_FORMAT_UMS = new DecimalFormat("#.0#####");
|
||||||
public static final DecimalFormat TIME_FORMAT_MS = new DecimalFormat("#.0#####");
|
public static final long[] POWERS_OF_TEN = {
|
||||||
|
1L,
|
||||||
|
10L,
|
||||||
|
100L,
|
||||||
|
1_000L,
|
||||||
|
10_000L,
|
||||||
|
100_000L,
|
||||||
|
1_000_000L,
|
||||||
|
10_000_000L,
|
||||||
|
100_000_000L,
|
||||||
|
1_000_000_000L,
|
||||||
|
10_000_000_000L,
|
||||||
|
100_000_000_000L,
|
||||||
|
1_000_000_000_000L,
|
||||||
|
10_000_000_000_000L,
|
||||||
|
100_000_000_000_000L,
|
||||||
|
1_000_000_000_000_000L};
|
||||||
|
|
||||||
|
public static DecimalFormat getTimeFormatForLevel(int idx) {
|
||||||
public static DecimalFormat getTimeFormatForLevel(int level) {
|
switch(idx) {
|
||||||
switch(level/SCALE_MULTIPLIER.length) {
|
|
||||||
case 0: return TIME_FORMAT_FS;
|
case 0: return TIME_FORMAT_FS;
|
||||||
case 1: return TIME_FORMAT_PS;
|
case 1: return TIME_FORMAT_PS;
|
||||||
case 2: return TIME_FORMAT_NS;
|
case 2: return TIME_FORMAT_NS;
|
||||||
case 3: return TIME_FORMAT_US;
|
|
||||||
case 4: return TIME_FORMAT_MS;
|
|
||||||
default:
|
default:
|
||||||
return TIME_FORMAT_FS;
|
return TIME_FORMAT_UMS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private Constants() {}
|
private Constants() {}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ArrowPainter implements IPainter {
|
||||||
this.tx = newTx;
|
this.tx = newTx;
|
||||||
iRect = new LinkedList<>();
|
iRect = new LinkedList<>();
|
||||||
oRect = new LinkedList<>();
|
oRect = new LinkedList<>();
|
||||||
scaleFactor = waveCanvas.getScaleFactor();
|
scaleFactor = waveCanvas.getScale();
|
||||||
if (tx != null) {
|
if (tx != null) {
|
||||||
calculateGeometries();
|
calculateGeometries();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ public class ArrowPainter implements IPainter {
|
||||||
Color highliteColor = waveCanvas.styleProvider.getColor(WaveformColors.REL_ARROW_HIGHLITE);
|
Color highliteColor = waveCanvas.styleProvider.getColor(WaveformColors.REL_ARROW_HIGHLITE);
|
||||||
|
|
||||||
if(tx==null) return;
|
if(tx==null) return;
|
||||||
scaleFactor = waveCanvas.getScaleFactor();
|
scaleFactor = waveCanvas.getScale();
|
||||||
if(calculateGeometries())
|
if(calculateGeometries())
|
||||||
return;
|
return;
|
||||||
int correctionValue = (int)(selectionOffset);
|
int correctionValue = (int)(selectionOffset);
|
||||||
|
|
|
@ -15,7 +15,6 @@ import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
|
||||||
import com.minres.scviewer.database.ui.ICursor;
|
import com.minres.scviewer.database.ui.ICursor;
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
|
||||||
|
|
||||||
public class CursorPainter implements IPainter, ICursor {
|
public class CursorPainter implements IPainter, ICursor {
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ public class CursorPainter implements IPainter, ICursor {
|
||||||
Rectangle area = proj.unProject(clientRect);
|
Rectangle area = proj.unProject(clientRect);
|
||||||
if(!waveCanvas.painterList.isEmpty()){
|
if(!waveCanvas.painterList.isEmpty()){
|
||||||
|
|
||||||
long scaleFactor=waveCanvas.getScaleFactor();
|
long scaleFactor=waveCanvas.getScale();
|
||||||
long beginPos = area.x;
|
long beginPos = area.x;
|
||||||
|
|
||||||
maxPosX = area.x + area.width;
|
maxPosX = area.x + area.width;
|
||||||
|
@ -84,8 +83,7 @@ public class CursorPainter implements IPainter, ICursor {
|
||||||
proj.drawLine(x, top, x, area.y+area.height);
|
proj.drawLine(x, top, x, area.y+area.height);
|
||||||
proj.setBackground(drawColor);
|
proj.setBackground(drawColor);
|
||||||
proj.setForeground(textColor);
|
proj.setForeground(textColor);
|
||||||
double dTime=time;
|
proj.drawText(waveCanvas.timeToString(time), x+1, top);
|
||||||
proj.drawText(Constants.getTimeFormatForLevel(waveCanvas.getZoomLevel()).format(dTime/waveCanvas.getScaleFactorPow10())+waveCanvas.getUnitStr(), x+1, top);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ package com.minres.scviewer.database.ui.swt.internal;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
import org.eclipse.swt.graphics.GC;
|
import org.eclipse.swt.graphics.GC;
|
||||||
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
import org.eclipse.wb.swt.SWTResourceManager;
|
import org.eclipse.wb.swt.SWTResourceManager;
|
||||||
|
|
||||||
|
@ -37,26 +38,26 @@ public class RulerPainter implements IPainter {
|
||||||
Color headerBgColor = waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
|
Color headerBgColor = waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
|
||||||
if(headerBgColor.isDisposed())
|
if(headerBgColor.isDisposed())
|
||||||
headerBgColor=SWTResourceManager.getColor(255,255,255);
|
headerBgColor=SWTResourceManager.getColor(255,255,255);
|
||||||
String unit=waveCanvas.getUnitStr();
|
|
||||||
long unitMultiplier=waveCanvas.getUnitMultiplier();
|
|
||||||
long scaleFactor=waveCanvas.getScaleFactor();
|
|
||||||
|
|
||||||
long startPos=area.x*scaleFactor;
|
long scaleFactor=waveCanvas.getScale();
|
||||||
long startVal=startPos - proj.getTranslation().x*scaleFactor;
|
long startTime=waveCanvas.getMinVisibleTime();
|
||||||
long endPos=startPos+area.width*scaleFactor;
|
long endTime=waveCanvas.getMaxVisibleTime();
|
||||||
|
|
||||||
long rulerTickMinor = RULER_TICK_MINOR*scaleFactor;
|
|
||||||
long rulerTickMajor = RULER_TICK_MAJOR*scaleFactor;
|
|
||||||
|
|
||||||
|
long multiplier = Constants.POWERS_OF_TEN[waveCanvas.getScaleMagnitude()];
|
||||||
|
long rulerTickMinor = RULER_TICK_MINOR*multiplier;
|
||||||
|
long rulerTickMajor = RULER_TICK_MAJOR*multiplier;
|
||||||
|
if((endTime-startTime)/rulerTickMinor>area.width/5) {
|
||||||
|
rulerTickMinor*=10;
|
||||||
|
rulerTickMajor*=10;
|
||||||
|
}
|
||||||
int minorTickY = waveCanvas.rulerHeight-5;
|
int minorTickY = waveCanvas.rulerHeight-5;
|
||||||
int majorTickY = waveCanvas.rulerHeight-15;
|
int majorTickY = waveCanvas.rulerHeight-15;
|
||||||
int textY=waveCanvas.rulerHeight-30;
|
int textY=waveCanvas.rulerHeight-30;
|
||||||
int baselineY=waveCanvas.rulerHeight - 1;
|
int baselineY=waveCanvas.rulerHeight - 1;
|
||||||
int bottom=waveCanvas.rulerHeight - 2;
|
int bottom=waveCanvas.rulerHeight - 2;
|
||||||
|
|
||||||
long modulo = startVal % rulerTickMinor;
|
long startTickTime = startTime+rulerTickMinor-(startTime % rulerTickMinor);
|
||||||
long startMinorIncrPos = startPos+rulerTickMinor-modulo;
|
long majorTickDist = rulerTickMajor/scaleFactor;
|
||||||
long startMinorIncrVal = startVal+rulerTickMinor-modulo;
|
|
||||||
|
|
||||||
gc.setBackground(waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
gc.setBackground(waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
||||||
gc.fillRectangle(new Rectangle(area.x, area.y, area.width, waveCanvas.rulerHeight));
|
gc.fillRectangle(new Rectangle(area.x, area.y, area.width, waveCanvas.rulerHeight));
|
||||||
|
@ -64,20 +65,20 @@ public class RulerPainter implements IPainter {
|
||||||
gc.fillRectangle(new Rectangle(area.x, area.y, area.width, baselineY));
|
gc.fillRectangle(new Rectangle(area.x, area.y, area.width, baselineY));
|
||||||
gc.setForeground(headerFgColor);
|
gc.setForeground(headerFgColor);
|
||||||
gc.drawLine(area.x, area.y+bottom, area.x+area.width, area.y+bottom);
|
gc.drawLine(area.x, area.y+bottom, area.x+area.width, area.y+bottom);
|
||||||
boolean allMarker=true;
|
int maxTextLength=0;
|
||||||
for (long pos = startMinorIncrPos, tick = startMinorIncrVal; pos < endPos; pos+= rulerTickMinor, tick += rulerTickMinor) {
|
for (long tickTime = startTickTime; tickTime < endTime; tickTime+= rulerTickMinor) {
|
||||||
if ((tick % rulerTickMajor) == 0) {
|
if ((tickTime % rulerTickMajor) == 0) {
|
||||||
String text = Constants.getTimeFormatForLevel(waveCanvas.getZoomLevel()).format(tick/scaleFactor*unitMultiplier);
|
Point textSize = gc.textExtent(waveCanvas.timeToString(tickTime));
|
||||||
if(text.length()>8) allMarker=false;
|
maxTextLength=textSize.x>maxTextLength?textSize.x:maxTextLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
boolean drawEvery = majorTickDist>maxTextLength;
|
||||||
boolean drawText=true;
|
boolean drawText=true;
|
||||||
for (long pos = startMinorIncrPos, tick = startMinorIncrVal; pos < endPos; pos+= rulerTickMinor, tick += rulerTickMinor) {
|
for (long tickTime = startTickTime; tickTime < endTime; tickTime+= rulerTickMinor) {
|
||||||
int x0Pos = (int) (pos/scaleFactor);
|
int x0Pos = (int) (tickTime/scaleFactor) + proj.getTranslation().x;
|
||||||
long x0Val = tick/scaleFactor;
|
if ((tickTime % rulerTickMajor) == 0) {
|
||||||
if ((tick % rulerTickMajor) == 0) {
|
if(drawEvery || drawText)
|
||||||
if(allMarker || drawText)
|
gc.drawText(waveCanvas.timeToString(tickTime), x0Pos, area.y+textY);
|
||||||
gc.drawText(Constants.getTimeFormatForLevel(waveCanvas.getZoomLevel()).format(x0Val*unitMultiplier)+unit, x0Pos, area.y+textY);
|
|
||||||
gc.drawLine(x0Pos, area.y+majorTickY, x0Pos,area.y+ bottom);
|
gc.drawLine(x0Pos, area.y+majorTickY, x0Pos,area.y+ bottom);
|
||||||
drawText=!drawText;
|
drawText=!drawText;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class SignalPainter extends TrackPainter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getXPosEnd(long time) {
|
private int getXPosEnd(long time) {
|
||||||
long ltmp = time / this.waveCanvas.getScaleFactor();
|
long ltmp = time / this.waveCanvas.getScale();
|
||||||
return ltmp > maxPosX ? maxPosX : (int) ltmp;
|
return ltmp > maxPosX ? maxPosX : (int) ltmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class SignalPainter extends TrackPainter {
|
||||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||||
proj.fillRectangle(area);
|
proj.fillRectangle(area);
|
||||||
|
|
||||||
long scaleFactor = this.waveCanvas.getScaleFactor();
|
long scaleFactor = this.waveCanvas.getScale();
|
||||||
long beginPos = area.x;
|
long beginPos = area.x;
|
||||||
long beginTime = beginPos*scaleFactor;
|
long beginTime = beginPos*scaleFactor;
|
||||||
long endTime = beginTime + area.width*scaleFactor;
|
long endTime = beginTime + area.width*scaleFactor;
|
||||||
|
@ -114,7 +114,7 @@ public class SignalPainter extends TrackPainter {
|
||||||
yOffsetT = this.waveCanvas.styleProvider.getTrackHeight() / 5 + area.y;
|
yOffsetT = this.waveCanvas.styleProvider.getTrackHeight() / 5 + area.y;
|
||||||
yOffsetM = this.waveCanvas.styleProvider.getTrackHeight() / 2 + area.y;
|
yOffsetM = this.waveCanvas.styleProvider.getTrackHeight() / 2 + area.y;
|
||||||
yOffsetB = 4 * this.waveCanvas.styleProvider.getTrackHeight() / 5 + area.y;
|
yOffsetB = 4 * this.waveCanvas.styleProvider.getTrackHeight() / 5 + area.y;
|
||||||
int xSigChangeBeginVal = Math.max(area.x, (int) (left.time / this.waveCanvas.getScaleFactor()));
|
int xSigChangeBeginVal = Math.max(area.x, (int) (left.time / this.waveCanvas.getScale()));
|
||||||
int xSigChangeBeginPos = area.x;
|
int xSigChangeBeginPos = area.x;
|
||||||
int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
|
int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ public class SignalPainter extends TrackPainter {
|
||||||
right.time = endTime;
|
right.time = endTime;
|
||||||
} else {
|
} else {
|
||||||
multiple = true;
|
multiple = true;
|
||||||
long eTime = (xSigChangeBeginVal + 1) * this.waveCanvas.getScaleFactor();
|
long eTime = (xSigChangeBeginVal + 1) * this.waveCanvas.getScale();
|
||||||
right.set(entries.floorEntry(eTime), endTime);
|
right.set(entries.floorEntry(eTime), endTime);
|
||||||
right.time = eTime;
|
right.time = eTime;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ public class SignalPainter extends TrackPainter {
|
||||||
multiple = false;
|
multiple = false;
|
||||||
if (xSigChangeEndPos == xSigChangeBeginPos) {
|
if (xSigChangeEndPos == xSigChangeBeginPos) {
|
||||||
multiple = true;
|
multiple = true;
|
||||||
long eTime = (xSigChangeBeginPos + 1) * this.waveCanvas.getScaleFactor();
|
long eTime = (xSigChangeBeginPos + 1) * this.waveCanvas.getScale();
|
||||||
EventEntry entry = entries.floorEntry(eTime);
|
EventEntry entry = entries.floorEntry(eTime);
|
||||||
if(entry!=null && entry.timestamp> right.time)
|
if(entry!=null && entry.timestamp> right.time)
|
||||||
right.set(entry, endTime);
|
right.set(entry, endTime);
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class StreamPainter extends TrackPainter{
|
||||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||||
proj.fillRectangle(area);
|
proj.fillRectangle(area);
|
||||||
|
|
||||||
long scaleFactor = this.waveCanvas.getScaleFactor();
|
long scaleFactor = this.waveCanvas.getScale();
|
||||||
long beginPos = area.x;
|
long beginPos = area.x;
|
||||||
long beginTime = beginPos*scaleFactor;
|
long beginTime = beginPos*scaleFactor;
|
||||||
long endTime = beginTime + area.width*scaleFactor;
|
long endTime = beginTime + area.width*scaleFactor;
|
||||||
|
@ -130,8 +130,8 @@ public class StreamPainter extends TrackPainter{
|
||||||
|
|
||||||
int offset = concurrencyIndex*this.waveCanvas.styleProvider.getTrackHeight();
|
int offset = concurrencyIndex*this.waveCanvas.styleProvider.getTrackHeight();
|
||||||
Rectangle bb = new Rectangle(
|
Rectangle bb = new Rectangle(
|
||||||
(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()), area.y+offset+txBase,
|
(int)(tx.getBeginTime()/this.waveCanvas.getScale()), area.y+offset+txBase,
|
||||||
(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScaleFactor()), txHeight);
|
(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScale()), txHeight);
|
||||||
|
|
||||||
if(bb.x+bb.width<area.x || bb.x>area.x+area.width) return;
|
if(bb.x+bb.width<area.x || bb.x>area.x+area.width) return;
|
||||||
if(bb.width==0){
|
if(bb.width==0){
|
||||||
|
@ -155,7 +155,7 @@ public class StreamPainter extends TrackPainter{
|
||||||
|
|
||||||
public ITx getClicked(Point point) {
|
public ITx getClicked(Point point) {
|
||||||
int lane=point.y/waveCanvas.styleProvider.getTrackHeight();
|
int lane=point.y/waveCanvas.styleProvider.getTrackHeight();
|
||||||
EventEntry firstTx=stream.getEvents().floorEntry(point.x*waveCanvas.getScaleFactor());
|
EventEntry firstTx=stream.getEvents().floorEntry(point.x*waveCanvas.getScale());
|
||||||
if(firstTx!=null){
|
if(firstTx!=null){
|
||||||
do {
|
do {
|
||||||
ITx tx = getTxFromEntry(lane, point.x, firstTx.events);
|
ITx tx = getTxFromEntry(lane, point.x, firstTx.events);
|
||||||
|
@ -175,9 +175,9 @@ public class StreamPainter extends TrackPainter{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ITx getTxFromEntry(int lane, int offset, IEvent[] firstTx) {
|
protected ITx getTxFromEntry(int lane, int offset, IEvent[] firstTx) {
|
||||||
long timePoint=offset*waveCanvas.getScaleFactor();
|
long timePoint=offset*waveCanvas.getScale();
|
||||||
long timePointLow=(offset-5)*waveCanvas.getScaleFactor();
|
long timePointLow=(offset-5)*waveCanvas.getScale();
|
||||||
long timePointHigh=(offset+5)*waveCanvas.getScaleFactor();
|
long timePointHigh=(offset+5)*waveCanvas.getScale();
|
||||||
for(IEvent e:firstTx){
|
for(IEvent e:firstTx){
|
||||||
if(e instanceof ITxEvent) {
|
if(e instanceof ITxEvent) {
|
||||||
ITxEvent evt = (ITxEvent) e;
|
ITxEvent evt = (ITxEvent) e;
|
||||||
|
|
|
@ -42,20 +42,24 @@ import com.minres.scviewer.database.tx.ITx;
|
||||||
import com.minres.scviewer.database.tx.ITxEvent;
|
import com.minres.scviewer.database.tx.ITxEvent;
|
||||||
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
|
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
|
import com.minres.scviewer.database.ui.IWaveformZoom;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
|
|
||||||
public class WaveformCanvas extends Canvas {
|
public class WaveformCanvas extends Canvas implements IWaveformZoom{
|
||||||
|
|
||||||
|
public static final long ZOOM_FIT = -2;
|
||||||
|
|
||||||
|
public static final long ZOOM_FULL = -1;
|
||||||
|
|
||||||
private boolean doubleBuffering = true;
|
private boolean doubleBuffering = true;
|
||||||
|
|
||||||
IWaveformStyleProvider styleProvider;
|
IWaveformStyleProvider styleProvider;
|
||||||
|
|
||||||
private long scaleFactor = 1000000L; // 1ns
|
private int scaleMagnitude = 6;
|
||||||
|
|
||||||
String unit="ns";
|
private long scaleFactor = Constants.POWERS_OF_TEN[scaleMagnitude];
|
||||||
|
|
||||||
private int level = 12;
|
|
||||||
|
|
||||||
private long maxTime;
|
private long maxTime;
|
||||||
|
|
||||||
|
@ -146,16 +150,17 @@ public class WaveformCanvas extends Canvas {
|
||||||
public void setOrigin(int x, int y) {
|
public void setOrigin(int x, int y) {
|
||||||
checkWidget();
|
checkWidget();
|
||||||
ScrollBar hBar = getHorizontalBar();
|
ScrollBar hBar = getHorizontalBar();
|
||||||
hBar.setSelection(-x);
|
if(x<=0) hBar.setSelection(-x);
|
||||||
x = -hBar.getSelection();
|
x = -hBar.getSelection();
|
||||||
ScrollBar vBar = getVerticalBar();
|
ScrollBar vBar = getVerticalBar();
|
||||||
vBar.setSelection(-y);
|
if(y<=0) vBar.setSelection(-y);
|
||||||
y = -vBar.getSelection();
|
y = -vBar.getSelection();
|
||||||
origin.x = x;
|
origin.x = x;
|
||||||
origin.y = y;
|
origin.y = y;
|
||||||
syncScrollBars();
|
syncScrollBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getMaxTime() {
|
public long getMaxTime() {
|
||||||
return maxTime;
|
return maxTime;
|
||||||
}
|
}
|
||||||
|
@ -165,36 +170,51 @@ public class WaveformCanvas extends Canvas {
|
||||||
syncScrollBars();
|
syncScrollBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getZoomLevel() {
|
@Override
|
||||||
return level;
|
public long getScale() {
|
||||||
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMaxZoomLevel(){
|
@Override
|
||||||
return Constants.SCALE_MULTIPLIER.length*Constants.UNIT_STRING.length-1;
|
public void setScale(long factor) {
|
||||||
|
setScalingFactor(factor, (getMaxVisibleTime()+getMinVisibleTime())/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setZoomLevel(int level) {
|
@Override
|
||||||
long tc=cursorPainters.get(0).getTime(); // cursor time
|
public void setVisibleRange(long startTime, long endTime) {
|
||||||
setZoomLevel(level, tc);
|
assert(startTime<endTime);
|
||||||
|
long time_diff = endTime-startTime;
|
||||||
|
long factor = (time_diff*11/10)/getClientArea().width;
|
||||||
|
setScalingFactor(factor, startTime+time_diff/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setZoomLevel(int level, long centerTime) {
|
//@Override
|
||||||
int maxLevel = findFitZoomLevel(maxTime);
|
public void setScalingFactor(long factor, long centerTime) {
|
||||||
if(level<0) {
|
Rectangle clientArea = getClientArea();
|
||||||
if(level<-1) {
|
long clientAreaWidth = clientArea.width;
|
||||||
|
long maxFactor=maxTime/clientAreaWidth;
|
||||||
|
if(factor<0) {
|
||||||
|
if(factor== ZOOM_FIT) {
|
||||||
long cTime = getCursorPainters().get(0).getTime();
|
long cTime = getCursorPainters().get(0).getTime();
|
||||||
long time_diff = centerTime>cTime?centerTime-cTime:cTime-centerTime;
|
long time_diff = centerTime>cTime?centerTime-cTime:cTime-centerTime;
|
||||||
level = findFitZoomLevel(time_diff);
|
|
||||||
centerTime = (centerTime>cTime?cTime:centerTime)+time_diff/2;
|
centerTime = (centerTime>cTime?cTime:centerTime)+time_diff/2;
|
||||||
} else
|
factor = (time_diff*11/10)/clientAreaWidth;
|
||||||
level=maxLevel;
|
} else if(factor== ZOOM_FULL)
|
||||||
if(level<0) level = 0;
|
factor = maxFactor;
|
||||||
|
}
|
||||||
|
if(factor==0)
|
||||||
|
factor=1;
|
||||||
|
else if(factor>maxFactor)
|
||||||
|
factor=maxFactor;
|
||||||
|
if(factor!=scaleFactor || (getMaxVisibleTime()+getMinVisibleTime()/2) != centerTime) {
|
||||||
|
scaleFactor = factor;
|
||||||
|
scaleMagnitude = 0;
|
||||||
|
for(int i=Constants.POWERS_OF_TEN.length-1; i>0; i--) {
|
||||||
|
if(scaleFactor>=Constants.POWERS_OF_TEN[i]) {
|
||||||
|
scaleMagnitude = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//FIXME: keep center if zoom-out and cursor is not in view
|
|
||||||
if(level<Constants.SCALE_MULTIPLIER.length*Constants.UNIT_STRING.length && level <= maxLevel){
|
|
||||||
int scale = level%Constants.SCALE_MULTIPLIER.length;
|
|
||||||
int unit = level/Constants.SCALE_MULTIPLIER.length;
|
|
||||||
this.scaleFactor = Constants.UNIT_MULTIPLIER[unit]*Constants.SCALE_MULTIPLIER[scale];
|
|
||||||
ITx tx = arrowPainter.getTx();
|
ITx tx = arrowPainter.getTx();
|
||||||
arrowPainter.setTx(null);
|
arrowPainter.setTx(null);
|
||||||
/*
|
/*
|
||||||
|
@ -203,8 +223,6 @@ public class WaveformCanvas extends Canvas {
|
||||||
* xcn = tc/newScaleFactor
|
* xcn = tc/newScaleFactor
|
||||||
* t0n = (xcn-xoffs)*scaleFactor
|
* t0n = (xcn-xoffs)*scaleFactor
|
||||||
*/
|
*/
|
||||||
Rectangle clientArea = getClientArea();
|
|
||||||
long clientAreaWidth = clientArea.width;
|
|
||||||
long xoffs = clientAreaWidth/2;
|
long xoffs = clientAreaWidth/2;
|
||||||
long xcn=centerTime/scaleFactor; // new total x-offset
|
long xcn=centerTime/scaleFactor; // new total x-offset
|
||||||
long originX=xcn-xoffs;
|
long originX=xcn-xoffs;
|
||||||
|
@ -216,43 +234,14 @@ public class WaveformCanvas extends Canvas {
|
||||||
syncScrollBars();
|
syncScrollBars();
|
||||||
arrowPainter.setTx(tx);
|
arrowPainter.setTx(tx);
|
||||||
redraw();
|
redraw();
|
||||||
this.level = level;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int findFitZoomLevel(long duration) {
|
@Override
|
||||||
//get area actually capable of displaying data, i.e. area of the receiver which is capable of displaying data
|
public String timeToString(long time) {
|
||||||
Rectangle clientArea = getClientArea();
|
int idx = scaleMagnitude/3;
|
||||||
long clientAreaWidth = clientArea.width;
|
double fTime = (double)time/Constants.UNIT_MULTIPLIER[idx];
|
||||||
//try to find existing zoomlevel where scaleFactor*clientAreaWidth >= maxTime, if one is found set it as new zoomlevel
|
return Constants.getTimeFormatForLevel(idx).format(fTime)+Constants.UNIT_STRING[idx];
|
||||||
for(int unitIdx=0; unitIdx<Constants.UNIT_STRING.length; unitIdx++) {
|
|
||||||
long magnitudeMultiplier = Constants.UNIT_MULTIPLIER[unitIdx];
|
|
||||||
for (int scaleIdx=0; scaleIdx<Constants.SCALE_MULTIPLIER.length; scaleIdx++){
|
|
||||||
long scaleFactor = magnitudeMultiplier * Constants.SCALE_MULTIPLIER[scaleIdx];
|
|
||||||
long range = scaleFactor*clientAreaWidth;
|
|
||||||
if( range >= duration)
|
|
||||||
return unitIdx*Constants.SCALE_MULTIPLIER.length+scaleIdx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getScaleFactor() {
|
|
||||||
return scaleFactor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getScaleFactorPow10() {
|
|
||||||
int scale = level/Constants.SCALE_MULTIPLIER.length;
|
|
||||||
double res = Math.pow(1000, scale);
|
|
||||||
return (long) res;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getUnitStr(){
|
|
||||||
return Constants.UNIT_STRING[level/Constants.SCALE_MULTIPLIER.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
public long getUnitMultiplier(){
|
|
||||||
return Constants.SCALE_MULTIPLIER[level%Constants.SCALE_MULTIPLIER.length];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTimeForOffset(int xOffset){
|
public long getTimeForOffset(int xOffset){
|
||||||
|
@ -504,6 +493,7 @@ public class WaveformCanvas extends Canvas {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void centerAt(long time) {
|
public void centerAt(long time) {
|
||||||
int scaledTime = (int) (time / scaleFactor);
|
int scaledTime = (int) (time / scaleFactor);
|
||||||
int newX = -scaledTime+getWidth()/2;
|
int newX = -scaledTime+getWidth()/2;
|
||||||
|
@ -542,16 +532,55 @@ public class WaveformCanvas extends Canvas {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
long getMaxVisibleTime() {
|
|
||||||
return (getClientArea().width+origin.x)*scaleFactor;
|
@Override
|
||||||
|
public long getMaxVisibleTime() {
|
||||||
|
return (getClientArea().width-origin.x)*scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
long getMinVisibleTime() {
|
@Override
|
||||||
return origin.x * scaleFactor;
|
public long getMinVisibleTime() {
|
||||||
|
return -origin.x * scaleFactor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setMinVisibleTime(long time) {
|
||||||
|
long duration = getMaxVisibleTime()-getMinVisibleTime();
|
||||||
|
if(time>0) {
|
||||||
|
if((time+duration)<getMaxTime()) {
|
||||||
|
int scaledTime = (int) (time / scaleFactor);
|
||||||
|
setOrigin(-scaledTime, origin.y);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setOrigin(0, origin.y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void zoom(ZoomKind kind) {
|
||||||
|
switch(kind) {
|
||||||
|
case IN:
|
||||||
|
setScale(getScale()/2);
|
||||||
|
break;
|
||||||
|
case OUT:
|
||||||
|
setScale(getScale()*2);
|
||||||
|
break;
|
||||||
|
case FIT:
|
||||||
|
setScalingFactor(WaveformCanvas.ZOOM_FIT, cursorPainters.get(1).getTime());
|
||||||
|
break;
|
||||||
|
case FULL:
|
||||||
|
setScale(WaveformCanvas.ZOOM_FULL);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStyleProvider(IWaveformStyleProvider styleProvider) {
|
public void setStyleProvider(IWaveformStyleProvider styleProvider) {
|
||||||
this.styleProvider=styleProvider;
|
this.styleProvider=styleProvider;
|
||||||
redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getScaleMagnitude() {
|
||||||
|
return scaleMagnitude;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,8 +89,8 @@ import com.minres.scviewer.database.ui.GotoDirection;
|
||||||
import com.minres.scviewer.database.ui.ICursor;
|
import com.minres.scviewer.database.ui.ICursor;
|
||||||
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
|
import com.minres.scviewer.database.ui.IWaveformStyleProvider;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
|
import com.minres.scviewer.database.ui.IWaveformZoom;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
|
||||||
|
|
||||||
public class WaveformView implements IWaveformView {
|
public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
|
@ -202,41 +202,17 @@ public class WaveformView implements IWaveformView {
|
||||||
asyncUpdate(e.widget);
|
asyncUpdate(e.widget);
|
||||||
long startTime = waveformCanvas.getTimeForOffset(start.x);
|
long startTime = waveformCanvas.getTimeForOffset(start.x);
|
||||||
long endTime = waveformCanvas.getTimeForOffset(end.x);
|
long endTime = waveformCanvas.getTimeForOffset(end.x);
|
||||||
long targetTimeRange = endTime - startTime;
|
if(startTime<endTime) {
|
||||||
long currentTimeRange = waveformCanvas.getMaxVisibleTime() - waveformCanvas.getMinVisibleTime();
|
waveformCanvas.setVisibleRange(startTime, endTime);
|
||||||
if (targetTimeRange == 0)
|
|
||||||
return;
|
|
||||||
long relation = currentTimeRange / targetTimeRange;
|
|
||||||
long i = 1;
|
|
||||||
int level = 0;
|
|
||||||
do {
|
|
||||||
if (relation < 0) {
|
|
||||||
if (-relation < i) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
level--;
|
|
||||||
if (-relation < i * 3) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
level--;
|
|
||||||
} else {
|
} else {
|
||||||
if (relation < i) {
|
long targetTimeRange = startTime-endTime;
|
||||||
break;
|
long currentTimeRange = waveformCanvas.getMaxVisibleTime() - waveformCanvas.getMinVisibleTime();
|
||||||
}
|
long factor = currentTimeRange/targetTimeRange *waveformCanvas.getScale();
|
||||||
level++;
|
waveformCanvas.setScalingFactor(factor, (startTime+endTime)/2);
|
||||||
if (relation < i * 3) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
level++;
|
|
||||||
}
|
|
||||||
i = i * 10;
|
|
||||||
} while (i < 10000);
|
|
||||||
if (i < 10000) {
|
|
||||||
int curLevel = waveformCanvas.getZoomLevel();
|
|
||||||
waveformCanvas.setZoomLevel(curLevel - level, (startTime + endTime) / 2);
|
|
||||||
}
|
}
|
||||||
} else if( isShift) { // set marker (button 1 and shift)
|
} else if( isShift) { // set marker (button 1 and shift)
|
||||||
setMarkerTime(snapOffsetToEvent(start), selectedMarker);
|
setMarkerTime(selectedMarker, snapOffsetToEvent(start));
|
||||||
} else if(isCtrl) { // set cursor (button 1 and ctrl)
|
} else if(isCtrl) { // set cursor (button 1 and ctrl)
|
||||||
setCursorTime(snapOffsetToEvent(start));
|
setCursorTime(snapOffsetToEvent(start));
|
||||||
} else { // set cursor (button 1 only)
|
} else { // set cursor (button 1 only)
|
||||||
|
@ -248,14 +224,14 @@ public class WaveformView implements IWaveformView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (e.button == 2) { // set marker (button 2)
|
} else if (e.button == 2) { // set marker (button 2)
|
||||||
setMarkerTime(snapOffsetToEvent(start), selectedMarker);
|
setMarkerTime(selectedMarker, snapOffsetToEvent(start));
|
||||||
}
|
}
|
||||||
asyncUpdate(e.widget);
|
asyncUpdate(e.widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected long snapOffsetToEvent(Point p) {
|
protected long snapOffsetToEvent(Point p) {
|
||||||
long time = waveformCanvas.getTimeForOffset(p.x);
|
long time = waveformCanvas.getTimeForOffset(p.x);
|
||||||
long scaling = 5 * waveformCanvas.getScaleFactor();
|
long scaling = 5 * waveformCanvas.getScale();
|
||||||
for (Object o : waveformCanvas.getElementsAt(p)) {
|
for (Object o : waveformCanvas.getElementsAt(p)) {
|
||||||
EventEntry floorEntry = null;
|
EventEntry floorEntry = null;
|
||||||
EventEntry ceilEntry = null;
|
EventEntry ceilEntry = null;
|
||||||
|
@ -290,11 +266,10 @@ public class WaveformView implements IWaveformView {
|
||||||
switch (e.type) {
|
switch (e.type) {
|
||||||
case SWT.MouseWheel:
|
case SWT.MouseWheel:
|
||||||
if((e.stateMask & SWT.CTRL) != 0) {
|
if((e.stateMask & SWT.CTRL) != 0) {
|
||||||
int zoom = waveformCanvas.getZoomLevel();
|
|
||||||
if(e.count<0)
|
if(e.count<0)
|
||||||
waveformCanvas.setZoomLevel(zoom+1);
|
waveformCanvas.setScale(waveformCanvas.getScale()*11/10);
|
||||||
else
|
else
|
||||||
waveformCanvas.setZoomLevel(zoom-1);
|
waveformCanvas.setScale(waveformCanvas.getScale()*10/11);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SWT.MouseDown:
|
case SWT.MouseDown:
|
||||||
|
@ -469,12 +444,12 @@ public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
toolTipHandler = new ToolTipHandler(parent.getShell());
|
toolTipHandler = new ToolTipHandler(parent.getShell());
|
||||||
toolTipHandler.activateHoverHelp(waveformCanvas);
|
toolTipHandler.activateHoverHelp(waveformCanvas);
|
||||||
// This is the filter that prevents it
|
// This is the filter that prevents the default handling of mouse wheel in waveformCanvas
|
||||||
getControl().getDisplay().addFilter(SWT.MouseWheel, new Listener() {
|
getControl().getDisplay().addFilter(SWT.MouseWheel, new Listener() {
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event e) {
|
public void handleEvent(Event e) {
|
||||||
// Check if it's the correct widget
|
// Check if it's the correct widget
|
||||||
if((e.widget.equals(waveformCanvas) || e.widget.equals(this)) && (e.stateMask & SWT.CTRL) != 0) {
|
if(e.widget.equals(waveformCanvas) && (e.stateMask & SWT.CTRL) != 0) {
|
||||||
waveformMouseListener.handleEvent(e);
|
waveformMouseListener.handleEvent(e);
|
||||||
e.doit = false;
|
e.doit = false;
|
||||||
}
|
}
|
||||||
|
@ -1137,16 +1112,6 @@ public class WaveformView implements IWaveformView {
|
||||||
this.waveformCanvas.setHighliteRelation(relationType);
|
this.waveformCanvas.setHighliteRelation(relationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#getMaxTime()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public long getMaxTime() {
|
|
||||||
return waveformCanvas.getMaxTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -1157,31 +1122,6 @@ public class WaveformView implements IWaveformView {
|
||||||
this.waveformCanvas.setMaxTime(maxTime);
|
this.waveformCanvas.setMaxTime(maxTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#setZoomLevel(int)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setZoomLevel(int scale) {
|
|
||||||
if(scale<-1) {
|
|
||||||
waveformCanvas.setZoomLevel(scale, getMarkerTime(selectedMarker));
|
|
||||||
} else {
|
|
||||||
waveformCanvas.setZoomLevel(scale);
|
|
||||||
waveformCanvas.reveal(getCursorTime());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#getZoomLevel()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int getZoomLevel() {
|
|
||||||
return waveformCanvas.getZoomLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -1200,10 +1140,10 @@ public class WaveformView implements IWaveformView {
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#setMarkerTime(long, int)
|
* @see com.minres.scviewer.database.swt.IWaveformPanel#setMarkerTime(long, int)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setMarkerTime(long time, int index) {
|
public void setMarkerTime(int marker, long time) {
|
||||||
if (waveformCanvas.getCursorPainters().size() > index + 1) {
|
if (waveformCanvas.getCursorPainters().size() > marker + 1) {
|
||||||
final Long oldVal = waveformCanvas.getCursorPainters().get(1 + index).getTime();
|
final Long oldVal = waveformCanvas.getCursorPainters().get(1 + marker).getTime();
|
||||||
waveformCanvas.getCursorPainters().get(1 + index).setTime(time);
|
waveformCanvas.getCursorPainters().get(1 + marker).setTime(time);
|
||||||
pcs.firePropertyChange(MARKER_PROPERTY, oldVal, time);
|
pcs.firePropertyChange(MARKER_PROPERTY, oldVal, time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1224,7 +1164,7 @@ public class WaveformView implements IWaveformView {
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#getActMarkerTime()
|
* @see com.minres.scviewer.database.swt.IWaveformPanel#getActMarkerTime()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getSelectedMarkerId() {
|
public int getSelectedMarker() {
|
||||||
return selectedMarker;
|
return selectedMarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1476,58 +1416,16 @@ public class WaveformView implements IWaveformView {
|
||||||
return this.pcs.hasListeners(propertyName);
|
return this.pcs.hasListeners(propertyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#getScaledTime(long)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String getScaledTime(long time) {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
double dTime = time;
|
|
||||||
double scaledTime = dTime / waveformCanvas.getScaleFactorPow10();
|
|
||||||
return sb.append(Constants.getTimeFormatForLevel(waveformCanvas.getZoomLevel()).format(scaledTime)).append(waveformCanvas.getUnitStr()).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#getZoomLevels()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String[] getZoomLevels() {
|
|
||||||
String[] res = new String[Constants.SCALE_MULTIPLIER.length * Constants.UNIT_STRING.length];
|
|
||||||
int index = 0;
|
|
||||||
for (String unit : Constants.UNIT_STRING) {
|
|
||||||
for (long factor : Constants.SCALE_MULTIPLIER) {
|
|
||||||
res[index++] = Long.toString(factor) + unit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getBaselineTime() {
|
|
||||||
return -waveformCanvas.getScaleFactorPow10() * waveformCanvas.getOrigin().x;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setBaselineTime(Long time) {
|
|
||||||
Point origin = waveformCanvas.getOrigin();
|
|
||||||
origin.x = (int) (-time / waveformCanvas.getScaleFactorPow10());
|
|
||||||
waveformCanvas.setOrigin(origin);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void scrollHorizontal(int percent) {
|
public void scrollHorizontal(int percent) {
|
||||||
if (percent < -100)
|
if (percent < -100)
|
||||||
percent = -100;
|
percent = -100;
|
||||||
if (percent > 100)
|
if (percent > 100)
|
||||||
percent = 100;
|
percent = 100;
|
||||||
int diff = (waveformCanvas.getWidth() * percent) / 100;
|
long minTime = waveformCanvas.getMinVisibleTime();
|
||||||
Point o = waveformCanvas.getOrigin();
|
long duration = waveformCanvas.getMaxVisibleTime()-minTime;
|
||||||
waveformCanvas.setOrigin(o.x - diff, o.y);
|
long diff = (duration * percent) / 100;
|
||||||
waveformCanvas.redraw();
|
waveformCanvas.setMinVisibleTime(minTime+diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1580,4 +1478,8 @@ public class WaveformView implements IWaveformView {
|
||||||
return streams.stream().filter(e -> e.waveform.getType() == WaveformType.TRANSACTION).findFirst().isPresent();
|
return streams.stream().filter(e -> e.waveform.getType() == WaveformType.TRANSACTION).findFirst().isPresent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IWaveformZoom getWaveformZoom() {
|
||||||
|
return waveformCanvas;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -81,41 +81,6 @@
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_FrGmEHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.movestreamdown" label="Move Stream down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" tooltip="Move stream/waveform in list down" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
|
<children xsi:type="menu:HandledToolItem" xmi:id="_FrGmEHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.movestreamdown" label="Move Stream down" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/down_blue.png" tooltip="Move stream/waveform in list down" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
|
||||||
<parameters xmi:id="_VA_yAHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.9" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
|
<parameters xmi:id="_VA_yAHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.9" name="com.minres.scviewer.e4.application.command.movewaveformupCommand.parameter.dir" value="down"/>
|
||||||
</children>
|
</children>
|
||||||
<children xsi:type="menu:ToolBarSeparator" xmi:id="_srcD0HgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.3"/>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_GKi7IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previousevent" label="Previous Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_blue.png" tooltip="Navigate to previous event in stream/waveform" command="_79rx4HabEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_XS7YYHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.10" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="prev"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_GjlGMHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nextevent" label="Next Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_blue.png" tooltip="Navigate to next event in stream/waveform" command="_79rx4HabEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_ZzTqcHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.11" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:ToolBarSeparator" xmi:id="_tcxaIHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.4"/>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_HdKZkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previoustransaction" label="Previous Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_green.png" tooltip="Navigate to previous transaction" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_cuGAkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.12" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="prev"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:ToolControl" xmi:id="_LtQhcIuKEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.toolcontrol.0" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.elements.RelationTypeToolControl"/>
|
|
||||||
<children xsi:type="menu:DirectToolItem" xmi:id="_Z7ZQkIuJEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.directtoolitem.nextprevinstream" toBeRendered="false" visible="false" label="Next/Prev in stream">
|
|
||||||
<menu xmi:id="_aPyMMIuJEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.menu.2">
|
|
||||||
<children xsi:type="menu:DynamicMenuContribution" xmi:id="_cnNWkIuJEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.dynamicmenucontribution.2" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.NavigateContribution"/>
|
|
||||||
</menu>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_H7bp8HcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nexttransaction" label="Next Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_green.png" tooltip="Navigate to next transaction" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_fiO8IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.13" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="next"/>
|
|
||||||
</children>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:ToolBar" xmi:id="_oQdMUHcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbar.1">
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_LFGfsEZEEeyKK_icsY7Xjg" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomfull" label="Zoom full" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_full.png" tooltip="Zoom full range" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_LFGfsUZEEeyKK_icsY7Xjg" elementId="com.minres.scviewer.e4.application.parameter.full" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="full"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_5DrGQHf4EeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomfit" label="Zoom fit" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_fit.png" tooltip="Zoom between cursor and marker" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_5DrGQXf4EeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.fit" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="fit"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:ToolBarSeparator" xmi:id="_p1AvUHcqEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.1"/>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_XMQPAHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomin" label="Zoom in" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/magnifier_zoom_in.png" tooltip="Zoom in" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_fi5w4HcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.in" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="in"/>
|
|
||||||
</children>
|
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_XqTc8HcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomout" label="Zoom out" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/magifier_zoom_out.png" tooltip="Zoom out" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
|
||||||
<parameters xmi:id="_d7OBYHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.out" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="out"/>
|
|
||||||
</children>
|
|
||||||
</children>
|
</children>
|
||||||
<children xsi:type="menu:ToolBar" xmi:id="_fwn8wGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.toolbar.2">
|
<children xsi:type="menu:ToolBar" xmi:id="_fwn8wGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.toolbar.2">
|
||||||
<children xsi:type="menu:HandledToolItem" xmi:id="_j-XIgGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.handledtoolitem.txdetails" label="TX Details" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/application_side_expand.png" tooltip="Show tx details parts" selected="true" type="Check" command="_Fj1gQEYoEeyKK_icsY7Xjg">
|
<children xsi:type="menu:HandledToolItem" xmi:id="_j-XIgGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.handledtoolitem.txdetails" label="TX Details" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/application_side_expand.png" tooltip="Show tx details parts" selected="true" type="Check" command="_Fj1gQEYoEeyKK_icsY7Xjg">
|
||||||
|
@ -195,6 +160,7 @@
|
||||||
<handlers xmi:id="_Du1NAHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.zoomCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ZoomHandler" command="_693GoHcqEeWwZ-9vrAR2UQ"/>
|
<handlers xmi:id="_Du1NAHcrEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handler.zoomCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ZoomHandler" command="_693GoHcqEeWwZ-9vrAR2UQ"/>
|
||||||
<handlers xmi:id="_bxt4QM3rEei6rfTGo88R-w" elementId="com.minres.scviewer.e4.application.handler.changeWaveDisplay" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ChangeWaveformDisplay" command="_FZunYM2PEei6rfTGo88R-w"/>
|
<handlers xmi:id="_bxt4QM3rEei6rfTGo88R-w" elementId="com.minres.scviewer.e4.application.handler.changeWaveDisplay" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ChangeWaveformDisplay" command="_FZunYM2PEei6rfTGo88R-w"/>
|
||||||
<handlers xmi:id="_bxw7kM3rEei6rfTGo88R-w" elementId="com.minres.scviewer.e4.application.handler.changeValueDisplay" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ChangeValueDisplay" command="_4C_asM3ZEei6rfTGo88R-w"/>
|
<handlers xmi:id="_bxw7kM3rEei6rfTGo88R-w" elementId="com.minres.scviewer.e4.application.handler.changeValueDisplay" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ChangeValueDisplay" command="_4C_asM3ZEei6rfTGo88R-w"/>
|
||||||
|
<handlers xmi:id="_ZVHbYE-JEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handler.panCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.PanHandler" command="_y2BUsE-HEeyuGJbYVZjX8w"/>
|
||||||
<menus xsi:type="menu:PopupMenu" xmi:id="_TwzrsHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.popupmenu.namecontext" label="Name Menu">
|
<menus xsi:type="menu:PopupMenu" xmi:id="_TwzrsHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.popupmenu.namecontext" label="Name Menu">
|
||||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_Vco7YHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.moveup" label="Move up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" tooltip="Move stream/waveform in list up" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
|
<children xsi:type="menu:HandledMenuItem" xmi:id="_Vco7YHWSEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledmenuitem.moveup" label="Move up" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/up_blue.png" tooltip="Move stream/waveform in list up" command="_N_sOkHXHEeWwZ-9vrAR2UQ">
|
||||||
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_elFdcHr_EeWVM_sKoXvptg" coreExpressionId="com.minres.scviewer.e4.application.oneWaveSeleted"/>
|
<visibleWhen xsi:type="ui:CoreExpression" xmi:id="_elFdcHr_EeWVM_sKoXvptg" coreExpressionId="com.minres.scviewer.e4.application.oneWaveSeleted"/>
|
||||||
|
@ -241,6 +207,46 @@
|
||||||
<visibleWhen xsi:type="ui:ImperativeExpression" xmi:id="_Se1voBlEEeuiP60JNw0iiA" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SearchHandler"/>
|
<visibleWhen xsi:type="ui:ImperativeExpression" xmi:id="_Se1voBlEEeuiP60JNw0iiA" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SearchHandler"/>
|
||||||
</children>
|
</children>
|
||||||
</menus>
|
</menus>
|
||||||
|
<toolbar xmi:id="_ReeeAE-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.toolbar.3">
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_GKi7IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previousevent" label="Previous Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/previous-green.png" tooltip="Navigate to previous event in stream/waveform" command="_79rx4HabEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_XS7YYHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.10" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="prev"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_GjlGMHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nextevent" label="Next Event" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/next-green.png" tooltip="Navigate to next event in stream/waveform" command="_79rx4HabEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_ZzTqcHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.11" name="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir" value="next"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:ToolBarSeparator" xmi:id="_tcxaIHgwEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.toolbarseparator.4"/>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_HdKZkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.previoustransaction" label="Previous Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_green.png" tooltip="Navigate to previous transaction" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_cuGAkHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.12" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="prev"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:ToolControl" xmi:id="_LtQhcIuKEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.toolcontrol.0" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.elements.RelationTypeToolControl"/>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_H7bp8HcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.handledtoolitem.nexttransaction" label="Next Transaction" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_green.png" tooltip="Navigate to next transaction" command="_Gn3lEHXKEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_fiO8IHcjEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parameter.13" name="com.minres.scviewer.e4.application.command.navigateTransCommand.parameter.dir" value="next"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:ToolBarSeparator" xmi:id="_dOLmYE-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.toolbarseparator.0"/>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_dPFBcE-HEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.panleft" label="Pan left" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/reverse_blue.png" tooltip="Pan left" command="_y2BUsE-HEeyuGJbYVZjX8w">
|
||||||
|
<parameters xmi:id="_jkVBYE-JEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.14" name="com.minres.scviewer.e4.application.command.pancommand.parameter.direction" value="left"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_Z-blgE-GEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.pancursor" label="Pan to cursor" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/center_blue.png" tooltip="Center on cursor" command="_y2BUsE-HEeyuGJbYVZjX8w">
|
||||||
|
<parameters xmi:id="_Z-blgU-GEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.out" name="com.minres.scviewer.e4.application.command.pancommand.parameter.direction" value="cursor"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_ejt5IE-HEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.panright" label="Pan right" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/play_blue.png" tooltip="Pan right" command="_y2BUsE-HEeyuGJbYVZjX8w">
|
||||||
|
<parameters xmi:id="_f4awUE-JEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.out" name="com.minres.scviewer.e4.application.command.pancommand.parameter.direction" value="right"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:ToolBarSeparator" xmi:id="_b7RFoE-GEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.toolbarseparator.1"/>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_qA5D4E-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomfull" label="Zoom full" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_full.png" tooltip="Zoom full range" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_qA5D4U-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.full" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="full"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_qA65EE-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomfit" label="Zoom fit" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/zoom_fit.png" tooltip="Zoom between cursor and marker" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_qA65EU-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.fit" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="fit"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:ToolBarSeparator" xmi:id="_qA8HME-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.toolbarseparator.1"/>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_qA8uQE-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomin" label="Zoom in" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/magnifier_zoom_in.png" tooltip="Zoom in" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_qA8uQU-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.in" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="in"/>
|
||||||
|
</children>
|
||||||
|
<children xsi:type="menu:HandledToolItem" xmi:id="_qA98YE-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.handledtoolitem.zoomout" label="Zoom out" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/magifier_zoom_out.png" tooltip="Zoom out" command="_693GoHcqEeWwZ-9vrAR2UQ">
|
||||||
|
<parameters xmi:id="_qA98YU-DEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.parameter.out" name="com.minres.scviewer.e4.application.command.zoomcommand.parameter.level" value="out"/>
|
||||||
|
</children>
|
||||||
|
</toolbar>
|
||||||
</descriptors>
|
</descriptors>
|
||||||
<snippets xsi:type="basic:Window" xmi:id="_R8mJUEhwEeyp3vLifEzGbQ" elementId="com.minres.scviewer.e4.application.window.help" selectedElement="_R8mJUUhwEeyp3vLifEzGbQ" label="SC Viewer Help" width="800" height="600">
|
<snippets xsi:type="basic:Window" xmi:id="_R8mJUEhwEeyp3vLifEzGbQ" elementId="com.minres.scviewer.e4.application.window.help" selectedElement="_R8mJUUhwEeyp3vLifEzGbQ" label="SC Viewer Help" width="800" height="600">
|
||||||
<children xsi:type="basic:Part" xmi:id="_R8mJUUhwEeyp3vLifEzGbQ" elementId="com.minres.scviewer.e4.application.part.container" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.help.HelpBrowser"/>
|
<children xsi:type="basic:Part" xmi:id="_R8mJUUhwEeyp3vLifEzGbQ" elementId="com.minres.scviewer.e4.application.part.container" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.help.HelpBrowser"/>
|
||||||
|
@ -289,6 +295,9 @@
|
||||||
<commands xmi:id="_-9ED4B06EeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.command.update" commandName="Update"/>
|
<commands xmi:id="_-9ED4B06EeuiP60JNw0iiA" elementId="com.minres.scviewer.e4.application.command.update" commandName="Update"/>
|
||||||
<commands xmi:id="_lqjIYEYEEeyPM8G0E2EYww" elementId="org.eclipse.ui.help.helpAction" commandName="Help Command"/>
|
<commands xmi:id="_lqjIYEYEEeyPM8G0E2EYww" elementId="org.eclipse.ui.help.helpAction" commandName="Help Command"/>
|
||||||
<commands xmi:id="_Fj1gQEYoEeyKK_icsY7Xjg" elementId="com.minres.scviewer.e4.application.command.enabletxdetails" commandName="Enable Tx Details" description="Show tx details parts"/>
|
<commands xmi:id="_Fj1gQEYoEeyKK_icsY7Xjg" elementId="com.minres.scviewer.e4.application.command.enabletxdetails" commandName="Enable Tx Details" description="Show tx details parts"/>
|
||||||
|
<commands xmi:id="_y2BUsE-HEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.command.pancommand" commandName="Pan Command">
|
||||||
|
<parameters xmi:id="_y2BUsU-HEeyuGJbYVZjX8w" elementId="com.minres.scviewer.e4.application.command.pancommand.parameter.direction" name="direction" optional="false"/>
|
||||||
|
</commands>
|
||||||
<addons xmi:id="_95PfsnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
|
<addons xmi:id="_95PfsnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
|
||||||
<addons xmi:id="_95Pfs3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
|
<addons xmi:id="_95Pfs3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
|
||||||
<addons xmi:id="_95PftHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
|
<addons xmi:id="_95PftHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %Bundle-Name
|
Bundle-Name: %Bundle-Name
|
||||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||||
Bundle-Version: 2.14.2
|
Bundle-Version: 2.15.0
|
||||||
Bundle-Vendor: %Bundle-Vendor
|
Bundle-Vendor: %Bundle-Vendor
|
||||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 600 B |
Binary file not shown.
After Width: | Height: | Size: 519 B |
Binary file not shown.
After Width: | Height: | Size: 524 B |
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -31,12 +31,16 @@ public class NavigateEvent {
|
||||||
final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir"; //$NON-NLS-1$
|
final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.navigateEventCommand.parameter.dir"; //$NON-NLS-1$
|
||||||
|
|
||||||
@CanExecute
|
@CanExecute
|
||||||
public Boolean canExecute(ESelectionService selectionService){
|
public Boolean canExecute(EPartService partService){
|
||||||
Object sel = selectionService.getSelection();
|
MPart part = partService.getActivePart();
|
||||||
|
if(part.getObject() instanceof WaveformViewer){
|
||||||
|
Object sel = ((WaveformViewer)part.getObject()).getSelection();
|
||||||
if( sel instanceof IStructuredSelection) {
|
if( sel instanceof IStructuredSelection) {
|
||||||
|
if(((IStructuredSelection)sel).isEmpty()) return false;
|
||||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||||
return o instanceof IWaveform || o instanceof ITx || o instanceof TrackEntry;
|
return o instanceof IWaveform || o instanceof ITx || o instanceof TrackEntry;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* MINRES Technologies GmbH - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
package com.minres.scviewer.e4.application.handlers;
|
||||||
|
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||||
|
import org.eclipse.e4.core.di.annotations.Execute;
|
||||||
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||||
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||||
|
|
||||||
|
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||||
|
|
||||||
|
public class PanHandler {
|
||||||
|
|
||||||
|
final static String PARAMTER_ID="com.minres.scviewer.e4.application.command.pancommand.parameter.direction"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@CanExecute
|
||||||
|
public boolean canExecute(EPartService partService) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Execute
|
||||||
|
public void execute(@Named(PARAMTER_ID) String level, EPartService partService) {
|
||||||
|
MPart part = partService.getActivePart();
|
||||||
|
Object obj = part.getObject();
|
||||||
|
if(obj instanceof WaveformViewer){
|
||||||
|
WaveformViewer waveformViewerPart = (WaveformViewer) obj;
|
||||||
|
if("left".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
|
waveformViewerPart.pan(-1);
|
||||||
|
else if("right".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
|
waveformViewerPart.pan(+1);
|
||||||
|
else if("cursor".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
|
waveformViewerPart.pan(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -18,6 +18,7 @@ import org.eclipse.e4.core.di.annotations.Execute;
|
||||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||||
|
|
||||||
public class ZoomHandler {
|
public class ZoomHandler {
|
||||||
|
@ -35,15 +36,14 @@ public class ZoomHandler {
|
||||||
Object obj = part.getObject();
|
Object obj = part.getObject();
|
||||||
if(obj instanceof WaveformViewer){
|
if(obj instanceof WaveformViewer){
|
||||||
WaveformViewer waveformViewerPart = (WaveformViewer) obj;
|
WaveformViewer waveformViewerPart = (WaveformViewer) obj;
|
||||||
int zoomLevel = waveformViewerPart.getZoomLevel();
|
|
||||||
if("in".equalsIgnoreCase(level)) //$NON-NLS-1$
|
if("in".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
waveformViewerPart.setZoomLevel(zoomLevel-1);
|
waveformViewerPart.zoom(ZoomKind.IN);
|
||||||
else if("out".equalsIgnoreCase(level)) //$NON-NLS-1$
|
else if("out".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
waveformViewerPart.setZoomLevel(zoomLevel+1);
|
waveformViewerPart.zoom(ZoomKind.OUT);
|
||||||
else if("fit".equalsIgnoreCase(level)) //$NON-NLS-1$
|
else if("fit".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
waveformViewerPart.setZoomFit();
|
waveformViewerPart.zoom(ZoomKind.FIT);
|
||||||
else if("full".equalsIgnoreCase(level)) //$NON-NLS-1$
|
else if("full".equalsIgnoreCase(level)) //$NON-NLS-1$
|
||||||
waveformViewerPart.setZoomFull();
|
waveformViewerPart.zoom(ZoomKind.FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,9 +27,6 @@ import com.minres.scviewer.e4.application.Messages;
|
||||||
*/
|
*/
|
||||||
public class WaveStatusBarControl extends StatusBarControl {
|
public class WaveStatusBarControl extends StatusBarControl {
|
||||||
|
|
||||||
/** The Constant ZOOM_LEVEL. */
|
|
||||||
public static final String ZOOM_LEVEL="ZoomLevelUpdate"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
/** The Constant CURSOR_TIME. */
|
/** The Constant CURSOR_TIME. */
|
||||||
public static final String CURSOR_TIME="CursorPosUpdate"; //$NON-NLS-1$
|
public static final String CURSOR_TIME="CursorPosUpdate"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -45,7 +42,7 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||||
|
|
||||||
|
|
||||||
/** The zoom contribution. */
|
/** The zoom contribution. */
|
||||||
StatusLineContributionItem cursorContribution, markerContribution, markerDiffContribution, zoomContribution;
|
StatusLineContributionItem cursorContribution, markerContribution, markerDiffContribution;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new wave status bar control.
|
* Instantiates a new wave status bar control.
|
||||||
|
@ -59,11 +56,9 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||||
cursorContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_5, true, 20);
|
cursorContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_5, true, 20);
|
||||||
markerContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_6, true, 20);
|
markerContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_6, true, 20);
|
||||||
markerDiffContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_7, true, 20);
|
markerDiffContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_7, true, 20);
|
||||||
zoomContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_8, true, 8);
|
|
||||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
|
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
|
||||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
|
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
|
||||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
|
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
|
||||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP, zoomContribution);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,17 +83,6 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the zoom event.
|
|
||||||
*
|
|
||||||
* @param text the text
|
|
||||||
* @return the zoom event
|
|
||||||
*/
|
|
||||||
@Inject @Optional
|
|
||||||
public void getZoomEvent(@UIEventTopic(ZOOM_LEVEL) String text) {
|
|
||||||
zoomContribution.setText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the cursor event.
|
* Gets the cursor event.
|
||||||
*
|
*
|
||||||
|
|
|
@ -94,6 +94,7 @@ import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
||||||
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.database.ui.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
import com.minres.scviewer.database.ui.swt.IToolTipContentProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipContentProvider;
|
||||||
import com.minres.scviewer.database.ui.swt.IToolTipHelpTextProvider;
|
import com.minres.scviewer.database.ui.swt.IToolTipHelpTextProvider;
|
||||||
|
@ -131,7 +132,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
protected static final String SHOWN_CURSOR = "SHOWN_CURSOR"; //$NON-NLS-1$
|
protected static final String SHOWN_CURSOR = "SHOWN_CURSOR"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** The Constant ZOOM_LEVEL. */
|
/** The Constant ZOOM_LEVEL. */
|
||||||
protected static final String ZOOM_LEVEL = "ZOOM_LEVEL"; //$NON-NLS-1$
|
protected static final String SCALING_FACTOR = "SCALING_FACTOR"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** The Constant BASE_LINE_TIME. */
|
/** The Constant BASE_LINE_TIME. */
|
||||||
protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
|
protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
|
||||||
|
@ -151,9 +152,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
/** The Constant TX_DETAILS_SHOWN. */
|
/** The Constant TX_DETAILS_SHOWN. */
|
||||||
protected static final String TX_DETAILS_SHOWN = "TX_DETAILS_SHOWN"; //$NON-NLS-1$
|
protected static final String TX_DETAILS_SHOWN = "TX_DETAILS_SHOWN"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** The zoom level. */
|
|
||||||
private String[] zoomLevel;
|
|
||||||
|
|
||||||
/** The Constant ID. */
|
/** The Constant ID. */
|
||||||
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -299,15 +297,15 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
|
|
||||||
waveformPane.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, evt -> {
|
waveformPane.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, evt -> {
|
||||||
Long time = (Long) evt.getNewValue();
|
Long time = (Long) evt.getNewValue();
|
||||||
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getScaledTime(time));
|
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getWaveformZoom().timeToString(time));
|
||||||
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarkerId());
|
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarker());
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(time - marker));
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getWaveformZoom().timeToString(time - marker));
|
||||||
});
|
});
|
||||||
waveformPane.addPropertyChangeListener(IWaveformView.MARKER_PROPERTY, evt -> {
|
waveformPane.addPropertyChangeListener(IWaveformView.MARKER_PROPERTY, evt -> {
|
||||||
Long time = (Long) evt.getNewValue();
|
Long time = (Long) evt.getNewValue();
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getScaledTime(time));
|
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getWaveformZoom().timeToString(time));
|
||||||
long cursor = waveformPane.getCursorTime();
|
long cursor = waveformPane.getCursorTime();
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getWaveformZoom().timeToString(cursor - time));
|
||||||
});
|
});
|
||||||
|
|
||||||
waveformPane.addSelectionChangedListener(event -> {
|
waveformPane.addSelectionChangedListener(event -> {
|
||||||
|
@ -319,17 +317,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
waveformPane.getWaveformControl().addListener(SWT.KeyDown, e -> {
|
waveformPane.getWaveformControl().addListener(SWT.KeyDown, e -> {
|
||||||
if((e.stateMask&SWT.MOD3)!=0) { // Alt key
|
if((e.stateMask&SWT.MOD3)!=0) { // Alt key
|
||||||
} else if((e.stateMask&SWT.MOD1)!=0) { //Ctrl/Cmd
|
} else if((e.stateMask&SWT.MOD1)!=0) { //Ctrl/Cmd
|
||||||
int zoomlevel = waveformPane.getZoomLevel();
|
|
||||||
switch(e.keyCode) {
|
switch(e.keyCode) {
|
||||||
case '+':
|
case '+':
|
||||||
case SWT.KEYPAD_ADD:
|
case SWT.KEYPAD_ADD:
|
||||||
if(zoomlevel>0)
|
waveformPane.getWaveformZoom().zoom(ZoomKind.IN);
|
||||||
waveformPane.setZoomLevel(zoomlevel-1);
|
|
||||||
return;
|
return;
|
||||||
case '-':
|
case '-':
|
||||||
case SWT.KEYPAD_SUBTRACT:
|
case SWT.KEYPAD_SUBTRACT:
|
||||||
if(zoomlevel<waveformPane.getZoomLevels().length-1)
|
waveformPane.getWaveformZoom().zoom(ZoomKind.OUT);
|
||||||
waveformPane.setZoomLevel(zoomlevel+1);
|
|
||||||
return;
|
return;
|
||||||
case SWT.ARROW_UP:
|
case SWT.ARROW_UP:
|
||||||
waveformPane.moveSelectedTrack(-1);
|
waveformPane.moveSelectedTrack(-1);
|
||||||
|
@ -381,7 +376,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
zoomLevel = waveformPane.getZoomLevels();
|
|
||||||
checkForUpdates = store.getBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
checkForUpdates = store.getBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
||||||
filesToLoad = new ArrayList<>();
|
filesToLoad = new ArrayList<>();
|
||||||
persistedState = part.getPersistedState();
|
persistedState = part.getPersistedState();
|
||||||
|
@ -392,7 +386,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
}
|
}
|
||||||
if (!filesToLoad.isEmpty())
|
if (!filesToLoad.isEmpty())
|
||||||
loadDatabase(persistedState);
|
loadDatabase(persistedState);
|
||||||
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, zoomLevel[waveformPane.getZoomLevel()]);
|
|
||||||
menuService.registerContextMenu(waveformPane.getNameControl(), MENU_CONTEXT);
|
menuService.registerContextMenu(waveformPane.getNameControl(), MENU_CONTEXT);
|
||||||
menuService.registerContextMenu(waveformPane.getValueControl(), MENU_CONTEXT);
|
menuService.registerContextMenu(waveformPane.getValueControl(), MENU_CONTEXT);
|
||||||
menuService.registerContextMenu(waveformPane.getWaveformControl(), MENU_CONTEXT);
|
menuService.registerContextMenu(waveformPane.getWaveformControl(), MENU_CONTEXT);
|
||||||
|
@ -750,8 +743,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
persistingState.put(SHOWN_CURSOR + index, Long.toString(cursor.getTime()));
|
persistingState.put(SHOWN_CURSOR + index, Long.toString(cursor.getTime()));
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
persistingState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
|
persistingState.put(SCALING_FACTOR, Long.toString(waveformPane.getWaveformZoom().getScale()));
|
||||||
persistingState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
|
persistingState.put(BASE_LINE_TIME, Long.toString(waveformPane.getWaveformZoom().getMinVisibleTime()));
|
||||||
|
|
||||||
// get selected transaction of a stream
|
// get selected transaction of a stream
|
||||||
ISelection selection = waveformPane.getSelection();
|
ISelection selection = waveformPane.getSelection();
|
||||||
|
@ -822,17 +815,17 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
cursors.get(i).setTime(time);
|
cursors.get(i).setTime(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (state.containsKey(ZOOM_LEVEL)) {
|
if (state.containsKey(SCALING_FACTOR)) {
|
||||||
try {
|
try {
|
||||||
Integer scale = Integer.parseInt(state.get(ZOOM_LEVEL));
|
long scale = Long.parseLong(state.get(SCALING_FACTOR));
|
||||||
waveformPane.setZoomLevel(scale);
|
waveformPane.getWaveformZoom().setScale(scale);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (state.containsKey(BASE_LINE_TIME)) {
|
if (state.containsKey(BASE_LINE_TIME)) {
|
||||||
try {
|
try {
|
||||||
Long scale = Long.parseLong(state.get(BASE_LINE_TIME));
|
Long scale = Long.parseLong(state.get(BASE_LINE_TIME));
|
||||||
waveformPane.setBaselineTime(scale);
|
waveformPane.getWaveformZoom().setMinVisibleTime(scale);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -871,12 +864,11 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
*/
|
*/
|
||||||
private void updateAll() {
|
private void updateAll() {
|
||||||
eventBroker.post(ACTIVE_WAVEFORMVIEW, this);
|
eventBroker.post(ACTIVE_WAVEFORMVIEW, this);
|
||||||
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, zoomLevel[waveformPane.getZoomLevel()]);
|
|
||||||
long cursor = waveformPane.getCursorTime();
|
long cursor = waveformPane.getCursorTime();
|
||||||
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarkerId());
|
long marker = waveformPane.getMarkerTime(waveformPane.getSelectedMarker());
|
||||||
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getScaledTime(cursor));
|
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, waveformPane.getWaveformZoom().timeToString(cursor));
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getScaledTime(marker));
|
eventBroker.post(WaveStatusBarControl.MARKER_TIME, waveformPane.getWaveformZoom().timeToString(marker));
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - marker));
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getWaveformZoom().timeToString(cursor - marker));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1047,42 +1039,33 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the zoom level.
|
* Execute the zoom according to kind.
|
||||||
*
|
*
|
||||||
* @param level the new zoom level
|
* @param kind the type of zoom to execute
|
||||||
*/
|
*/
|
||||||
public void setZoomLevel(Integer level) {
|
public void zoom(ZoomKind kind) {
|
||||||
if (level < 0)
|
waveformPane.getWaveformZoom().zoom(kind);
|
||||||
level = 0;
|
|
||||||
if (level > zoomLevel.length - 1)
|
|
||||||
level = zoomLevel.length - 1;
|
|
||||||
waveformPane.setZoomLevel(level);
|
|
||||||
updateAll();
|
updateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the zoom fit.
|
* Execute the zoom kind.
|
||||||
*/
|
|
||||||
public void setZoomFit() {
|
|
||||||
waveformPane.setZoomLevel(-2);
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the zoom fit.
|
|
||||||
*/
|
|
||||||
public void setZoomFull() {
|
|
||||||
waveformPane.setZoomLevel(-1);
|
|
||||||
updateAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the zoom level.
|
|
||||||
*
|
*
|
||||||
* @return the zoom level
|
* @param direction the direction of the pan (-1, 0, 1)
|
||||||
*/
|
*/
|
||||||
public int getZoomLevel() {
|
public void pan(int direction) {
|
||||||
return waveformPane.getZoomLevel();
|
switch(direction) {
|
||||||
|
case -1:
|
||||||
|
waveformPane.scrollHorizontal(-10);
|
||||||
|
return;
|
||||||
|
case 1:
|
||||||
|
waveformPane.scrollHorizontal(10);
|
||||||
|
return;
|
||||||
|
case 0:
|
||||||
|
waveformPane.scrollTo(IWaveformView.CURSOR_POS);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1113,7 +1096,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
* @return the scaled time
|
* @return the scaled time
|
||||||
*/
|
*/
|
||||||
public String getScaledTime(Long time) {
|
public String getScaledTime(Long time) {
|
||||||
return waveformPane.getScaledTime(time);
|
return waveformPane.getWaveformZoom().timeToString(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1239,7 +1222,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
public void widgetDisposed(DisposeEvent e) {
|
public void widgetDisposed(DisposeEvent e) {
|
||||||
disposeListenerNumber -= 1;
|
disposeListenerNumber -= 1;
|
||||||
if( disposeListenerNumber == 0) { //if the last tab is closed, reset statusbar
|
if( disposeListenerNumber == 0) { //if the last tab is closed, reset statusbar
|
||||||
eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, null);
|
|
||||||
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, null);
|
eventBroker.post(WaveStatusBarControl.CURSOR_TIME, null);
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_TIME, null);
|
eventBroker.post(WaveStatusBarControl.MARKER_TIME, null);
|
||||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null);
|
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null);
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.minres.scviewer.e4.application.parts.help;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.PreDestroy;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||||
|
@ -24,7 +23,6 @@ import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Listener;
|
import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.ProgressBar;
|
import org.eclipse.swt.widgets.ProgressBar;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.swt.widgets.ToolBar;
|
import org.eclipse.swt.widgets.ToolBar;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
import org.eclipse.swt.widgets.ToolItem;
|
||||||
|
|
|
@ -139,19 +139,7 @@
|
||||||
</visibleWhen>
|
</visibleWhen>
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
commandId="com.minres.scviewer.ui.zoom.in"
|
||||||
id="com.minres.scviewer.ui.zoom.command"
|
|
||||||
style="pulldown"
|
|
||||||
tooltip="Set zoom level">
|
|
||||||
<visibleWhen
|
|
||||||
checkEnabled="false">
|
|
||||||
<reference
|
|
||||||
definitionId="com.minres.scviewer.ui.waveEditorActive">
|
|
||||||
</reference>
|
|
||||||
</visibleWhen>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoomin"
|
|
||||||
label="Zoom in"
|
label="Zoom in"
|
||||||
style="push"
|
style="push"
|
||||||
tooltip="Zoom into">
|
tooltip="Zoom into">
|
||||||
|
@ -163,7 +151,7 @@
|
||||||
</visibleWhen>
|
</visibleWhen>
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
commandId="com.minres.scviewer.ui.zoomout"
|
commandId="com.minres.scviewer.ui.zoom.out"
|
||||||
label="Zoom out"
|
label="Zoom out"
|
||||||
style="push"
|
style="push"
|
||||||
tooltip="Zoom out of">
|
tooltip="Zoom out of">
|
||||||
|
@ -176,119 +164,6 @@
|
||||||
</command>
|
</command>
|
||||||
</toolbar>
|
</toolbar>
|
||||||
</menuContribution>
|
</menuContribution>
|
||||||
<menuContribution
|
|
||||||
locationURI="menu:com.minres.scviewer.ui.zoom.command">
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="100ps"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 100ps">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="5">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="1ns"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 1ns">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="6">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="10ns"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 10ns">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="7">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="100ns"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 100ns">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="8">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="1µs"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 1us">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="9">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="10µs"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 10us">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="10">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="100µs"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 100us">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="11">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="1ms"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 1ms">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="12">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="10ms"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 10ms">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="13">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="100ms"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 100ms">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="14">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
|
||||||
label="1s"
|
|
||||||
style="push"
|
|
||||||
tooltip="Resolution 1s">
|
|
||||||
<parameter
|
|
||||||
name="com.minres.scviewer.ui.zoom.level"
|
|
||||||
value="15">
|
|
||||||
</parameter>
|
|
||||||
</command>
|
|
||||||
</menuContribution>
|
|
||||||
<menuContribution
|
<menuContribution
|
||||||
allPopups="false"
|
allPopups="false"
|
||||||
locationURI="popup:com.minres.scviewer.ui.TxEditorPart">
|
locationURI="popup:com.minres.scviewer.ui.TxEditorPart">
|
||||||
|
@ -305,7 +180,7 @@
|
||||||
</visibleWhen>
|
</visibleWhen>
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
commandId="com.minres.scviewer.ui.zoomin"
|
commandId="com.minres.scviewer.ui.zoom.in"
|
||||||
label="Zoom in"
|
label="Zoom in"
|
||||||
style="push"
|
style="push"
|
||||||
tooltip="Zoom into">
|
tooltip="Zoom into">
|
||||||
|
@ -317,7 +192,7 @@
|
||||||
</visibleWhen>
|
</visibleWhen>
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
commandId="com.minres.scviewer.ui.zoomout"
|
commandId="com.minres.scviewer.ui.zoom.out"
|
||||||
label="Zoom out"
|
label="Zoom out"
|
||||||
style="push"
|
style="push"
|
||||||
tooltip="Zoom out of">
|
tooltip="Zoom out of">
|
||||||
|
@ -367,24 +242,21 @@
|
||||||
name="Prev">
|
name="Prev">
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
defaultHandler="com.minres.scviewer.ui.handler.Zoom"
|
id="com.minres.scviewer.ui.zoom.in"
|
||||||
description="Set the zoom level"
|
|
||||||
id="com.minres.scviewer.ui.zoom"
|
|
||||||
name="Zoom">
|
|
||||||
<commandParameter
|
|
||||||
id="com.minres.scviewer.ui.zoom.level"
|
|
||||||
name="level"
|
|
||||||
optional="true">
|
|
||||||
</commandParameter>
|
|
||||||
</command>
|
|
||||||
<command
|
|
||||||
id="com.minres.scviewer.ui.zoomin"
|
|
||||||
name="Zoom in">
|
name="Zoom in">
|
||||||
</command>
|
</command>
|
||||||
<command
|
<command
|
||||||
id="com.minres.scviewer.ui.zoomout"
|
id="com.minres.scviewer.ui.zoom.out"
|
||||||
name="Zoom out">
|
name="Zoom out">
|
||||||
</command>
|
</command>
|
||||||
|
<command
|
||||||
|
id="com.minres.scviewer.ui.zoom.fit"
|
||||||
|
name="Zoom fit">
|
||||||
|
</command>
|
||||||
|
<command
|
||||||
|
id="com.minres.scviewer.ui.zoom.full"
|
||||||
|
name="Zoom full">
|
||||||
|
</command>
|
||||||
<command
|
<command
|
||||||
id="com.minres.scviewer.ui.removeWave"
|
id="com.minres.scviewer.ui.removeWave"
|
||||||
name="Remove wave">
|
name="Remove wave">
|
||||||
|
@ -411,8 +283,8 @@
|
||||||
</enabledWhen>
|
</enabledWhen>
|
||||||
</handler>
|
</handler>
|
||||||
<handler
|
<handler
|
||||||
class="com.minres.scviewer.ui.handler.ZoomInOut"
|
class="com.minres.scviewer.ui.handler.Zoom"
|
||||||
commandId="com.minres.scviewer.ui.zoomin">
|
commandId="com.minres.scviewer.ui.zoom.in">
|
||||||
<enabledWhen>
|
<enabledWhen>
|
||||||
<reference
|
<reference
|
||||||
definitionId="com.minres.scviewer.ui.waveEditorActive">
|
definitionId="com.minres.scviewer.ui.waveEditorActive">
|
||||||
|
@ -420,8 +292,8 @@
|
||||||
</enabledWhen>
|
</enabledWhen>
|
||||||
</handler>
|
</handler>
|
||||||
<handler
|
<handler
|
||||||
class="com.minres.scviewer.ui.handler.ZoomInOut"
|
class="com.minres.scviewer.ui.handler.Zoom"
|
||||||
commandId="com.minres.scviewer.ui.zoomout">
|
commandId="com.minres.scviewer.ui.zoom.out">
|
||||||
<enabledWhen>
|
<enabledWhen>
|
||||||
<reference
|
<reference
|
||||||
definitionId="com.minres.scviewer.ui.waveEditorActive">
|
definitionId="com.minres.scviewer.ui.waveEditorActive">
|
||||||
|
@ -493,15 +365,11 @@
|
||||||
icon="res/images/next-green.png">
|
icon="res/images/next-green.png">
|
||||||
</image>
|
</image>
|
||||||
<image
|
<image
|
||||||
commandId="com.minres.scviewer.ui.zoom"
|
commandId="com.minres.scviewer.ui.zoom.in"
|
||||||
icon="res/images/zoom.png">
|
|
||||||
</image>
|
|
||||||
<image
|
|
||||||
commandId="com.minres.scviewer.ui.zoomin"
|
|
||||||
icon="res/images/zoom_in.png">
|
icon="res/images/zoom_in.png">
|
||||||
</image>
|
</image>
|
||||||
<image
|
<image
|
||||||
commandId="com.minres.scviewer.ui.zoomout"
|
commandId="com.minres.scviewer.ui.zoom.out"
|
||||||
icon="res/images/zoom_out.png">
|
icon="res/images/zoom_out.png">
|
||||||
</image>
|
</image>
|
||||||
<image
|
<image
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
|
|
|
@ -50,6 +50,7 @@ import com.minres.scviewer.database.IWaveformDbFactory;
|
||||||
import com.minres.scviewer.database.ui.GotoDirection;
|
import com.minres.scviewer.database.ui.GotoDirection;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
||||||
import com.minres.scviewer.ui.views.TxOutlinePage;
|
import com.minres.scviewer.ui.views.TxOutlinePage;
|
||||||
|
|
||||||
|
@ -66,13 +67,6 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||||
waveformDbFactory=null;
|
waveformDbFactory=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static String[] zoomLevel={
|
|
||||||
"1fs", "10fs", "100fs",
|
|
||||||
"1ps", "10ps", "100ps",
|
|
||||||
"1ns", "10ns", "100ns",
|
|
||||||
"1µs", "10µs", "10µs",
|
|
||||||
"1ms", "10ms", "100ms", "1s"};
|
|
||||||
|
|
||||||
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
||||||
|
|
||||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
||||||
|
@ -85,7 +79,6 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||||
private Composite myParent;
|
private Composite myParent;
|
||||||
|
|
||||||
private StatusLineContributionItem cursorStatusLineItem;
|
private StatusLineContributionItem cursorStatusLineItem;
|
||||||
private StatusLineContributionItem zoomStatusLineItem;
|
|
||||||
|
|
||||||
public TxEditorPart() {
|
public TxEditorPart() {
|
||||||
}
|
}
|
||||||
|
@ -132,7 +125,6 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).run();
|
}).run();
|
||||||
zoomStatusLineItem.setText("Zoom level: "+zoomLevel[waveformView.getZoomLevel()]);
|
|
||||||
cursorStatusLineItem.setText("Cursor: "+ waveformView.getCursorTime()/1000000+"ns");
|
cursorStatusLineItem.setText("Cursor: "+ waveformView.getCursorTime()/1000000+"ns");
|
||||||
MenuManager menuMgr = new MenuManager("#PopupMenu");
|
MenuManager menuMgr = new MenuManager("#PopupMenu");
|
||||||
// menuMgr.setRemoveAllWhenShown(true);
|
// menuMgr.setRemoveAllWhenShown(true);
|
||||||
|
@ -306,11 +298,9 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||||
// Initialize the editor part
|
// Initialize the editor part
|
||||||
setSite(site);
|
setSite(site);
|
||||||
setInput(input);
|
setInput(input);
|
||||||
zoomStatusLineItem = new StatusLineContributionItem("TxEditorZoomContributionItem");
|
|
||||||
cursorStatusLineItem = new StatusLineContributionItem("TxEditorCursorContributionItem");
|
cursorStatusLineItem = new StatusLineContributionItem("TxEditorCursorContributionItem");
|
||||||
IActionBars actionBars = getEditorSite().getActionBars();
|
IActionBars actionBars = getEditorSite().getActionBars();
|
||||||
IStatusLineManager manager = actionBars.getStatusLineManager();
|
IStatusLineManager manager = actionBars.getStatusLineManager();
|
||||||
manager.add(zoomStatusLineItem);
|
|
||||||
manager.add(cursorStatusLineItem);
|
manager.add(cursorStatusLineItem);
|
||||||
actionBars.updateActionBars();
|
actionBars.updateActionBars();
|
||||||
}
|
}
|
||||||
|
@ -388,16 +378,8 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||||
waveformView.moveSelection( next);
|
waveformView.moveSelection( next);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setZoomLevel(Integer level) {
|
public void setZoom(ZoomKind kind) {
|
||||||
waveformView.setZoomLevel(level);
|
waveformView.getWaveformZoom().zoom(kind);
|
||||||
}
|
|
||||||
|
|
||||||
public void setZoomFit() {
|
|
||||||
waveformView.setZoomLevel(6);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getZoomLevel() {
|
|
||||||
return waveformView.getZoomLevel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeSelected() {
|
public void removeSelected() {
|
||||||
|
|
|
@ -16,24 +16,29 @@ import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.ui.IEditorPart;
|
import org.eclipse.ui.IEditorPart;
|
||||||
import org.eclipse.ui.handlers.HandlerUtil;
|
import org.eclipse.ui.handlers.HandlerUtil;
|
||||||
|
|
||||||
|
import com.minres.scviewer.database.ui.ZoomKind;
|
||||||
import com.minres.scviewer.ui.TxEditorPart;
|
import com.minres.scviewer.ui.TxEditorPart;
|
||||||
|
|
||||||
public class Zoom extends AbstractHandler {
|
public class Zoom extends AbstractHandler {
|
||||||
private static final String PARM_MSG = "com.minres.scviewer.ui.zoom.level";
|
private static final String ZOOMIN_ID = "com.minres.scviewer.ui.zoom.in";
|
||||||
|
private static final String ZOOMOUT_ID = "com.minres.scviewer.ui.zoom.out";
|
||||||
|
private static final String ZOOMFIT_ID = "com.minres.scviewer.ui.zoom.fit";
|
||||||
|
private static final String ZOOMFULL_ID = "com.minres.scviewer.ui.zoom.full";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
IEditorPart editor = HandlerUtil.getActiveEditor(event);
|
IEditorPart editor = HandlerUtil.getActiveEditor(event);
|
||||||
String msg = event.getParameter(PARM_MSG);
|
|
||||||
if (msg == null) {
|
|
||||||
if(editor instanceof TxEditorPart){
|
if(editor instanceof TxEditorPart){
|
||||||
((TxEditorPart)editor).setZoomFit();
|
String id = event.getCommand().getId();
|
||||||
}
|
TxEditorPart txEditor=(TxEditorPart) editor;
|
||||||
} else {
|
if (ZOOMIN_ID.compareTo(id) == 0)
|
||||||
Integer level = Integer.parseInt(msg);
|
txEditor.setZoom(ZoomKind.IN);
|
||||||
if(editor instanceof TxEditorPart){
|
else if(ZOOMOUT_ID.compareTo(id) == 0)
|
||||||
((TxEditorPart)editor).setZoomLevel(level);
|
txEditor.setZoom(ZoomKind.OUT);
|
||||||
}
|
else if(ZOOMFIT_ID.compareTo(id) == 0)
|
||||||
|
txEditor.setZoom(ZoomKind.FIT);
|
||||||
|
else if(ZOOMFULL_ID.compareTo(id) == 0)
|
||||||
|
txEditor.setZoom(ZoomKind.FULL);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
|
|
||||||
* All rights reserved. This program and the accompanying materials
|
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
|
||||||
* which accompanies this distribution, and is available at
|
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
|
||||||
*
|
|
||||||
* Contributors:
|
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package com.minres.scviewer.ui.handler;
|
|
||||||
|
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
|
||||||
import org.eclipse.core.commands.ExecutionException;
|
|
||||||
import org.eclipse.ui.IEditorPart;
|
|
||||||
import org.eclipse.ui.handlers.HandlerUtil;
|
|
||||||
|
|
||||||
import com.minres.scviewer.ui.TxEditorPart;
|
|
||||||
|
|
||||||
public class ZoomInOut extends AbstractHandler {
|
|
||||||
private static final String ZOOMIN_ID = "com.minres.scviewer.ui.zoomin";
|
|
||||||
private static final String ZOOMOUT_ID= "com.minres.scviewer.ui.zoomout";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
|
||||||
IEditorPart editor = HandlerUtil.getActiveEditor(event);
|
|
||||||
if(editor instanceof TxEditorPart){
|
|
||||||
String id = event.getCommand().getId();
|
|
||||||
TxEditorPart txEditor=(TxEditorPart) editor;
|
|
||||||
if (ZOOMIN_ID.compareTo(id) == 0)
|
|
||||||
txEditor.setZoomLevel(txEditor.getZoomLevel()-1);
|
|
||||||
else if(ZOOMOUT_ID.compareTo(id) == 0)
|
|
||||||
txEditor.setZoomLevel(txEditor.getZoomLevel()+1);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
7
pom.xml
7
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>releng/com.minres.scviewer.target</module>
|
<module>releng/com.minres.scviewer.target</module>
|
||||||
|
@ -29,6 +29,8 @@
|
||||||
<tycho-version>1.5.0</tycho-version>
|
<tycho-version>1.5.0</tycho-version>
|
||||||
<groovy-eclipse-compiler-version>3.6.0-03</groovy-eclipse-compiler-version>
|
<groovy-eclipse-compiler-version>3.6.0-03</groovy-eclipse-compiler-version>
|
||||||
<groovy-eclipse-batch-version>3.0.3-01</groovy-eclipse-batch-version>
|
<groovy-eclipse-batch-version>3.0.3-01</groovy-eclipse-batch-version>
|
||||||
|
<!-- <software.download.area>${user.home}/deployment-work/${DEPLOY_WORK_DIRECTORY}</software.download.area> -->
|
||||||
|
<software.download.area>${project.build.directory}/../</software.download.area>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -67,7 +69,7 @@
|
||||||
<artifact>
|
<artifact>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.target</artifactId>
|
<artifactId>com.minres.scviewer.target</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
</artifact>
|
</artifact>
|
||||||
</target>
|
</target>
|
||||||
<environments>
|
<environments>
|
||||||
|
@ -125,7 +127,6 @@
|
||||||
<plugin id="org.hamcrest.core" />
|
<plugin id="org.hamcrest.core" />
|
||||||
<plugin id="org.junit" />
|
<plugin id="org.junit" />
|
||||||
<plugin id="com.minres.scviewer.e4.product" />
|
<plugin id="com.minres.scviewer.e4.product" />
|
||||||
<plugin id="com.minres.scviewer.e4.product_slim" />
|
|
||||||
<plugin id="org.eclipse.core.filesystem.linux.x86_64" />
|
<plugin id="org.eclipse.core.filesystem.linux.x86_64" />
|
||||||
<plugin id="org.eclipse.core.filesystem.win32.x86_64" />
|
<plugin id="org.eclipse.core.filesystem.win32.x86_64" />
|
||||||
<plugin id="com.opcoach.e4.preferences" />
|
<plugin id="com.opcoach.e4.preferences" />
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<packaging>eclipse-repository</packaging>
|
<packaging>eclipse-repository</packaging>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<?pde version="3.5"?>
|
<?pde version="3.5"?>
|
||||||
|
|
||||||
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.14.2" useFeatures="true" includeLaunchers="true">
|
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.15.0" useFeatures="true" includeLaunchers="true">
|
||||||
|
|
||||||
<configIni use="default">
|
<configIni use="default">
|
||||||
</configIni>
|
</configIni>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
/artifacts.jar
|
/artifacts.jar
|
||||||
/content.jar
|
/content.jar
|
||||||
/target/
|
/target/
|
||||||
|
/gh-pages/
|
||||||
|
|
|
@ -0,0 +1,104 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<project name="project">
|
||||||
|
|
||||||
|
<target name="getMajorMinorVersion">
|
||||||
|
<script language="javascript">
|
||||||
|
<![CDATA[
|
||||||
|
|
||||||
|
// getting the value
|
||||||
|
buildnumber = project.getProperty("unqualifiedVersion");
|
||||||
|
index = buildnumber.lastIndexOf(".");
|
||||||
|
counter = buildnumber.substring(0, index);
|
||||||
|
project.setProperty("majorMinorVersion",counter);
|
||||||
|
|
||||||
|
]]>
|
||||||
|
</script>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="test_getMajorMinor" depends="getMajorMinorVersion">
|
||||||
|
<echo message="majorMinorVersion: ${majorMinorVersion}"/>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
site.label The name/title/label of the created composite site
|
||||||
|
unqualifiedVersion The version without any qualifier replacement
|
||||||
|
buildQualifier The build qualifier
|
||||||
|
-->
|
||||||
|
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
|
||||||
|
<property name="full.version" value="${unqualifiedVersion}" />
|
||||||
|
|
||||||
|
<property name="software.download.area" location="${user.home}/p2.repositories" />
|
||||||
|
<property name="updates.dir" value="updates" />
|
||||||
|
|
||||||
|
<property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
|
||||||
|
<property name="main.site.composite.name" value="${site.label} All Versions" />
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<property name="main.composite.repository.directory" location="${software.download.area}/${updates.dir}" />
|
||||||
|
-->
|
||||||
|
<property name="main.composite.repository.directory" location="${software.download.area}" />
|
||||||
|
|
||||||
|
<property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
|
||||||
|
<property name="child.repository" value="${full.version}" />
|
||||||
|
<property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="p2.composite.add" depends="compute.child.repository.data">
|
||||||
|
<property name="source.repository" location="${project.build.directory}/repository"/>
|
||||||
|
|
||||||
|
<echo message=" " />
|
||||||
|
|
||||||
|
<echo message="Source repository path: ${source.repository}" />
|
||||||
|
|
||||||
|
<echo message="Copying to ${child.repository.directory}..." />
|
||||||
|
|
||||||
|
<mkdir dir="${child.repository.directory}"/>
|
||||||
|
<copy todir="${child.repository.directory}" overwrite="true">
|
||||||
|
<fileset dir="${source.repository}" />
|
||||||
|
</copy>
|
||||||
|
|
||||||
|
<add.composite.repository.internal
|
||||||
|
composite.repository.location="${composite.repository.directory}"
|
||||||
|
composite.repository.name="${site.composite.name}"
|
||||||
|
composite.repository.child="${child.repository}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<add.composite.repository.internal
|
||||||
|
composite.repository.location="${main.composite.repository.directory}"
|
||||||
|
composite.repository.name="${main.site.composite.name}"
|
||||||
|
composite.repository.child="${majorMinorVersion}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!-- = = = = = = = = = = = = = = = = =
|
||||||
|
macrodef: add.composite.repository.internal
|
||||||
|
= = = = = = = = = = = = = = = = = -->
|
||||||
|
<macrodef name="add.composite.repository.internal">
|
||||||
|
<attribute name="composite.repository.location" />
|
||||||
|
<attribute name="composite.repository.name" />
|
||||||
|
<attribute name="composite.repository.child" />
|
||||||
|
<sequential>
|
||||||
|
|
||||||
|
<echo message=" " />
|
||||||
|
<echo message="Composite repository : @{composite.repository.location}" />
|
||||||
|
<echo message="Composite name : @{composite.repository.name}" />
|
||||||
|
<echo message="Adding child repository : @{composite.repository.child}" />
|
||||||
|
|
||||||
|
<p2.composite.repository>
|
||||||
|
<repository compressed="false" location="@{composite.repository.location}" name="@{composite.repository.name}" />
|
||||||
|
<add>
|
||||||
|
<repository location="@{composite.repository.child}" />
|
||||||
|
</add>
|
||||||
|
</p2.composite.repository>
|
||||||
|
|
||||||
|
<echo file="@{composite.repository.location}/p2.index">version=1
|
||||||
|
metadata.repository.factory.order=compositeContent.xml,\!
|
||||||
|
artifact.repository.factory.order=compositeArtifacts.xml,\!
|
||||||
|
</echo>
|
||||||
|
|
||||||
|
</sequential>
|
||||||
|
</macrodef>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
|
@ -23,6 +23,7 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<!-- Activate this profile to perform the release to Bintray -->
|
<!-- Activate this profile to perform the release to Bintray -->
|
||||||
|
@ -33,37 +34,77 @@
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.carrotgarden.maven</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>bintray-maven-plugin</artifactId>
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
<version>1.5.20191113165555</version>
|
<version>3.0.0</version>
|
||||||
<configuration>
|
|
||||||
<skip>false</skip>
|
|
||||||
<!-- Bintray organization name. -->
|
|
||||||
<subject>minres</subject>
|
|
||||||
<!-- Bintray target repository. -->
|
|
||||||
<repository>eclipse</repository>
|
|
||||||
<!-- Bintray package name -->
|
|
||||||
<bintrayPackage>SCViewer</bintrayPackage>
|
|
||||||
<!-- Bintray package version number -->
|
|
||||||
<bintrayVersion>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</bintrayVersion>
|
|
||||||
<!-- remove any preexisting files -->
|
|
||||||
<performDestroy>true</performDestroy>
|
|
||||||
<!-- information used when creating the package -->
|
|
||||||
<packageVcsUrl>https://git.minres.com/VP-Tools/SCViewer.git</packageVcsUrl>
|
|
||||||
<packageLicenses>EPL-1.0</packageLicenses>
|
|
||||||
<!-- Local folder content to sync to the remote repo. -->
|
|
||||||
<sourceFolder>${project.build.directory}/repository</sourceFolder>
|
|
||||||
<!-- Remote folder for local content upload, relative path. -->
|
|
||||||
<targetFolder>SCViewer/${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</targetFolder>
|
|
||||||
<!-- Bintray credentials in settings.xml. -->
|
|
||||||
<serverId>bintray-minres-deploy</serverId>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
<executions>
|
||||||
<!-- Activate "bintray:upload" during "package" -->
|
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>upload</goal>
|
<goal>exec</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<executable>bash</executable>
|
||||||
|
<!-- optional -->
|
||||||
|
<workingDirectory>${software.download.area}</workingDirectory>
|
||||||
|
<arguments>
|
||||||
|
<argument>-c</argument>
|
||||||
|
<argument>if [ -d gh-pages ]; then cd gh-pages; git pull; else git clone --branch gh-pages https://git.minres.com/VP-Tools/SCViewer.git gh-pages; fi</argument>
|
||||||
|
</arguments>
|
||||||
|
<environmentVariables>
|
||||||
|
<LANG>en_US</LANG>
|
||||||
|
</environmentVariables>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.eclipse.tycho.extras</groupId>
|
||||||
|
<artifactId>tycho-eclipserun-plugin</artifactId>
|
||||||
|
<version>${tycho-version}</version>
|
||||||
|
<configuration>
|
||||||
|
<!-- IMPORTANT: DO NOT split the arg line -->
|
||||||
|
<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile packaging-p2-composite.ant p2.composite.add -Dsite.label="SCViewer Software Repository" -Dproject.build.directory=${project.build.directory} -DunqualifiedVersion=${unqualifiedVersion} -Dsoftware.download.area="${software.download.area}/gh-pages/repository"</appArgLine>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>2020-03</id>
|
||||||
|
<layout>p2</layout>
|
||||||
|
<url>http://download.eclipse.org/releases/2020-03/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.eclipse.ant.core</artifactId>
|
||||||
|
<type>eclipse-plugin</type>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.apache.ant</artifactId>
|
||||||
|
<type>eclipse-plugin</type>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.eclipse.equinox.p2.repository.tools</artifactId>
|
||||||
|
<type>eclipse-plugin</type>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.eclipse.equinox.p2.core.feature</artifactId>
|
||||||
|
<type>eclipse-feature</type>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.eclipse.equinox.p2.extras.feature</artifactId>
|
||||||
|
<type>eclipse-feature</type>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>org.eclipse.equinox.ds</artifactId>
|
||||||
|
<type>eclipse-plugin</type>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>add-p2-composite-repository</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>eclipse-run</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
<version>2.14.2</version>
|
<version>2.15.0</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>eclipse-test-plugin</packaging>
|
<packaging>eclipse-test-plugin</packaging>
|
||||||
|
|
Loading…
Reference in New Issue