Merge branch 'release/2.2.0'
This commit is contained in:
commit
e8682e446b
|
@ -28,7 +28,6 @@ import com.minres.scviewer.database.IWaveform
|
||||||
import com.minres.scviewer.database.IWaveformDb
|
import com.minres.scviewer.database.IWaveformDb
|
||||||
import com.minres.scviewer.database.IWaveformDbLoader
|
import com.minres.scviewer.database.IWaveformDbLoader
|
||||||
import com.minres.scviewer.database.RelationType
|
import com.minres.scviewer.database.RelationType
|
||||||
import com.minres.scviewer.database.DataType
|
|
||||||
|
|
||||||
public class TextDbLoader implements IWaveformDbLoader{
|
public class TextDbLoader implements IWaveformDbLoader{
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ public class RulerPainter implements IPainter {
|
||||||
long startPos=area.x*scaleFactor;
|
long startPos=area.x*scaleFactor;
|
||||||
long startVal=startPos + waveCanvas.getXOffset()*scaleFactor;
|
long startVal=startPos + waveCanvas.getXOffset()*scaleFactor;
|
||||||
long endPos=startPos+area.width*scaleFactor;
|
long endPos=startPos+area.width*scaleFactor;
|
||||||
long endVal=startVal+area.width*scaleFactor;
|
|
||||||
|
|
||||||
long rulerTickMinor = rulerTickMinorC*scaleFactor;
|
long rulerTickMinor = rulerTickMinorC*scaleFactor;
|
||||||
long rulerTickMajor = rulerTickMajorC*scaleFactor;
|
long rulerTickMajor = rulerTickMajorC*scaleFactor;
|
||||||
|
@ -68,12 +67,9 @@ public class RulerPainter implements IPainter {
|
||||||
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);
|
||||||
|
|
||||||
int x0_max = 0;
|
|
||||||
|
|
||||||
for (long pos = startMinorIncrPos, tick = startMinorIncrVal; pos < endPos; pos+= rulerTickMinor, tick += rulerTickMinor) {
|
for (long pos = startMinorIncrPos, tick = startMinorIncrVal; pos < endPos; pos+= rulerTickMinor, tick += rulerTickMinor) {
|
||||||
int x0_pos = (int) (pos/scaleFactor);
|
int x0_pos = (int) (pos/scaleFactor);
|
||||||
long x0_val = tick/scaleFactor;
|
long x0_val = tick/scaleFactor;
|
||||||
x0_max = x0_pos;
|
|
||||||
if ((tick % rulerTickMajor) == 0) {
|
if ((tick % rulerTickMajor) == 0) {
|
||||||
gc.drawText(df.format(x0_val*unitMultiplier)+unit, x0_pos, area.y+textY);
|
gc.drawText(df.format(x0_val*unitMultiplier)+unit, x0_pos, area.y+textY);
|
||||||
gc.drawLine(x0_pos, area.y+majorTickY, x0_pos,area.y+ bottom);
|
gc.drawLine(x0_pos, area.y+majorTickY, x0_pos,area.y+ bottom);
|
||||||
|
|
|
@ -78,11 +78,6 @@ public class SignalPainter extends TrackPainter {
|
||||||
this.waveCanvas = txDisplay;
|
this.waveCanvas = txDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getXValEnd(long time) {
|
|
||||||
long ltmp = time / this.waveCanvas.getScaleFactor();
|
|
||||||
return ltmp > maxValX ? maxValX : (int) ltmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getXPosEnd(long time) {
|
private int getXPosEnd(long time) {
|
||||||
long ltmp = time / this.waveCanvas.getScaleFactor() - waveCanvas.getXOffset();
|
long ltmp = time / this.waveCanvas.getScaleFactor() - waveCanvas.getXOffset();
|
||||||
return ltmp > maxPosX ? maxPosX : (int) ltmp;
|
return ltmp > maxPosX ? maxPosX : (int) ltmp;
|
||||||
|
@ -100,7 +95,6 @@ public class SignalPainter extends TrackPainter {
|
||||||
long scaleFactor = this.waveCanvas.getScaleFactor();
|
long scaleFactor = this.waveCanvas.getScaleFactor();
|
||||||
long beginPos = area.x;
|
long beginPos = area.x;
|
||||||
long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
|
long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
|
||||||
long endPos = beginPos + area.width;
|
|
||||||
long endTime = beginTime + area.width*scaleFactor;
|
long endTime = beginTime + area.width*scaleFactor;
|
||||||
|
|
||||||
Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
|
Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
|
||||||
|
@ -125,7 +119,6 @@ public class SignalPainter extends TrackPainter {
|
||||||
yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
|
yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
|
||||||
int xSigChangeBeginVal = Math.max(area.x + (int)waveCanvas.getXOffset(), (int) (left.time / this.waveCanvas.getScaleFactor()));
|
int xSigChangeBeginVal = Math.max(area.x + (int)waveCanvas.getXOffset(), (int) (left.time / this.waveCanvas.getScaleFactor()));
|
||||||
int xSigChangeBeginPos = area.x;
|
int xSigChangeBeginPos = area.x;
|
||||||
int xSigChangeEndVal = Math.max(area.x + (int)waveCanvas.getXOffset(), getXValEnd(right.time));
|
|
||||||
int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
|
int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
|
||||||
|
|
||||||
boolean multiple = false;
|
boolean multiple = false;
|
||||||
|
|
|
@ -235,6 +235,7 @@ public class WaveformCanvas extends Canvas{
|
||||||
|
|
||||||
public void setZoomLevel(int level, long centerTime) {
|
public void setZoomLevel(int level, long centerTime) {
|
||||||
long oldScaleFactor=scaleFactor;
|
long oldScaleFactor=scaleFactor;
|
||||||
|
if(level<0) level = 0;
|
||||||
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.scaleFactor = (long) Math.pow(10, level/2);
|
this.scaleFactor = (long) Math.pow(10, level/2);
|
||||||
|
|
|
@ -40,7 +40,6 @@ import org.eclipse.swt.dnd.DND;
|
||||||
import org.eclipse.swt.dnd.DragSource;
|
import org.eclipse.swt.dnd.DragSource;
|
||||||
import org.eclipse.swt.dnd.DragSourceAdapter;
|
import org.eclipse.swt.dnd.DragSourceAdapter;
|
||||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||||
import org.eclipse.swt.dnd.DragSourceListener;
|
|
||||||
import org.eclipse.swt.dnd.DropTarget;
|
import org.eclipse.swt.dnd.DropTarget;
|
||||||
import org.eclipse.swt.dnd.DropTargetAdapter;
|
import org.eclipse.swt.dnd.DropTargetAdapter;
|
||||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||||
|
@ -181,9 +180,11 @@ public class WaveformViewer implements IWaveformViewer {
|
||||||
GC gc = e.gc;
|
GC gc = e.gc;
|
||||||
gc.setAlpha(128);
|
gc.setAlpha(128);
|
||||||
int minX = Math.min(start.x, end.x);
|
int minX = Math.min(start.x, end.x);
|
||||||
int maxX = Math.max(start.x, end.x);
|
int width = Math.max(start.x, end.x) - minX;
|
||||||
int width = maxX - minX;
|
Point origin = waveformCanvas.getOrigin();
|
||||||
gc.fillRectangle(minX, 0, width, e.height);
|
int y_top = waveformCanvas.getRulerHeight()- origin.y;
|
||||||
|
int y_bottom = waveformCanvas.getSize().y;
|
||||||
|
gc.fillRectangle(minX, y_top, width,y_bottom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ package com.minres.scviewer.database.vcd;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -5,7 +5,8 @@ Bundle-SymbolicName: com.minres.scviewer.database
|
||||||
Bundle-Version: 1.0.0.qualifier
|
Bundle-Version: 1.0.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Export-Package: com.minres.scviewer.database
|
Export-Package: com.minres.scviewer.database,
|
||||||
|
com.minres.scviewer.database.internal;x-internal:=true
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
|
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
|
||||||
Automatic-Module-Name: com.minres.scviewer.database
|
Automatic-Module-Name: com.minres.scviewer.database
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
output.. = bin/
|
|
||||||
bin.includes = META-INF/,\
|
bin.includes = META-INF/,\
|
||||||
.,\
|
.,\
|
||||||
plugin.xml,\
|
plugin.xml,\
|
||||||
|
|
|
@ -139,6 +139,7 @@ public class AboutDialog extends Dialog {
|
||||||
// links are activated on mouse down when the control key is held down
|
// links are activated on mouse down when the control key is held down
|
||||||
// if ((event.stateMask & SWT.MOD1) != 0) {
|
// if ((event.stateMask & SWT.MOD1) != 0) {
|
||||||
try {
|
try {
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
int offset = ((StyledText)event.widget).getOffsetAtLocation(new Point (event.x, event.y));
|
int offset = ((StyledText)event.widget).getOffsetAtLocation(new Point (event.x, event.y));
|
||||||
StyleRange style = ((StyledText)event.widget).getStyleRangeAtOffset(offset);
|
StyleRange style = ((StyledText)event.widget).getStyleRangeAtOffset(offset);
|
||||||
if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK) {
|
if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK) {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import java.util.List;
|
||||||
import com.minres.scviewer.database.IHierNode;
|
import com.minres.scviewer.database.IHierNode;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
import com.minres.scviewer.database.IWaveformDb;
|
||||||
import com.minres.scviewer.database.IWaveformEvent;
|
|
||||||
import com.minres.scviewer.database.RelationType;
|
import com.minres.scviewer.database.RelationType;
|
||||||
import com.minres.scviewer.e4.application.Messages;
|
import com.minres.scviewer.e4.application.Messages;
|
||||||
|
|
||||||
|
|
|
@ -277,43 +277,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
waveformPane.getWaveformControl().addMouseTrackListener(new MouseTrackListener() {
|
|
||||||
@Override
|
|
||||||
public void mouseHover(MouseEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void mouseExit(MouseEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void mouseEnter(MouseEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
waveformPane.getWaveformControl().addMouseWheelListener(new MouseWheelListener() {
|
|
||||||
@Override
|
|
||||||
public void mouseScrolled(MouseEvent e) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
waveformPane.getWaveformControl().addListener(SWT.KeyDown, new Listener() {
|
waveformPane.getWaveformControl().addListener(SWT.KeyDown, new Listener() {
|
||||||
@SuppressWarnings("null")
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(Event e) {
|
public void handleEvent(Event e) {
|
||||||
/*
|
|
||||||
String string = e.type == SWT.KeyDown ? "DOWN:" : "UP :";
|
|
||||||
string += " stateMask=0x" + Integer.toHexString (e.stateMask) + ","; // SWT.CTRL, SWT.ALT, SWT.SHIFT, SWT.COMMAND
|
|
||||||
string += " keyCode=0x" + Integer.toHexString (e.keyCode) + ",";
|
|
||||||
string += " character=0x" + Integer.toHexString (e.character) ;
|
|
||||||
if (e.keyLocation != 0) {
|
|
||||||
string += " location="+e.keyLocation;
|
|
||||||
}
|
|
||||||
System.out.println (string);
|
|
||||||
*/
|
|
||||||
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();
|
int zoomlevel = waveformPane.getZoomLevel();
|
||||||
|
|
Loading…
Reference in New Issue