Merge branch 'release/2.2.0'

This commit is contained in:
Eyck Jentzsch 2020-03-14 15:56:36 +01:00
commit e8682e446b
11 changed files with 10 additions and 54 deletions

View File

@ -28,7 +28,6 @@ import com.minres.scviewer.database.IWaveform
import com.minres.scviewer.database.IWaveformDb
import com.minres.scviewer.database.IWaveformDbLoader
import com.minres.scviewer.database.RelationType
import com.minres.scviewer.database.DataType
public class TextDbLoader implements IWaveformDbLoader{

View File

@ -46,7 +46,6 @@ public class RulerPainter implements IPainter {
long startPos=area.x*scaleFactor;
long startVal=startPos + waveCanvas.getXOffset()*scaleFactor;
long endPos=startPos+area.width*scaleFactor;
long endVal=startVal+area.width*scaleFactor;
long rulerTickMinor = rulerTickMinorC*scaleFactor;
long rulerTickMajor = rulerTickMajorC*scaleFactor;
@ -68,12 +67,9 @@ public class RulerPainter implements IPainter {
gc.setForeground(headerFgColor);
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) {
int x0_pos = (int) (pos/scaleFactor);
long x0_val = tick/scaleFactor;
x0_max = x0_pos;
if ((tick % rulerTickMajor) == 0) {
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);

View File

@ -78,11 +78,6 @@ public class SignalPainter extends TrackPainter {
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) {
long ltmp = time / this.waveCanvas.getScaleFactor() - waveCanvas.getXOffset();
return ltmp > maxPosX ? maxPosX : (int) ltmp;
@ -100,7 +95,6 @@ public class SignalPainter extends TrackPainter {
long scaleFactor = this.waveCanvas.getScaleFactor();
long beginPos = area.x;
long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
long endPos = beginPos + area.width;
long endTime = beginTime + area.width*scaleFactor;
Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
@ -125,7 +119,6 @@ public class SignalPainter extends TrackPainter {
yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
int xSigChangeBeginVal = Math.max(area.x + (int)waveCanvas.getXOffset(), (int) (left.time / this.waveCanvas.getScaleFactor()));
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));
boolean multiple = false;

View File

@ -235,6 +235,7 @@ public class WaveformCanvas extends Canvas{
public void setZoomLevel(int level, long centerTime) {
long oldScaleFactor=scaleFactor;
if(level<0) level = 0;
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
this.level = level;
this.scaleFactor = (long) Math.pow(10, level/2);

View File

@ -40,7 +40,6 @@ import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DragSource;
import org.eclipse.swt.dnd.DragSourceAdapter;
import org.eclipse.swt.dnd.DragSourceEvent;
import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetAdapter;
import org.eclipse.swt.dnd.DropTargetEvent;
@ -181,9 +180,11 @@ public class WaveformViewer implements IWaveformViewer {
GC gc = e.gc;
gc.setAlpha(128);
int minX = Math.min(start.x, end.x);
int maxX = Math.max(start.x, end.x);
int width = maxX - minX;
gc.fillRectangle(minX, 0, width, e.height);
int width = Math.max(start.x, end.x) - minX;
Point origin = waveformCanvas.getOrigin();
int y_top = waveformCanvas.getRulerHeight()- origin.y;
int y_bottom = waveformCanvas.getSize().y;
gc.fillRectangle(minX, y_top, width,y_bottom);
}
}

View File

@ -12,7 +12,6 @@ package com.minres.scviewer.database.vcd;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;

View File

@ -5,7 +5,8 @@ Bundle-SymbolicName: com.minres.scviewer.database
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: MINRES Technologies GmbH
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
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
Automatic-Module-Name: com.minres.scviewer.database

View File

@ -1,4 +1,3 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\

View File

@ -139,6 +139,7 @@ public class AboutDialog extends Dialog {
// links are activated on mouse down when the control key is held down
// if ((event.stateMask & SWT.MOD1) != 0) {
try {
@SuppressWarnings("deprecation")
int offset = ((StyledText)event.widget).getOffsetAtLocation(new Point (event.x, event.y));
StyleRange style = ((StyledText)event.widget).getStyleRangeAtOffset(offset);
if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK) {

View File

@ -8,7 +8,6 @@ import java.util.List;
import com.minres.scviewer.database.IHierNode;
import com.minres.scviewer.database.IWaveform;
import com.minres.scviewer.database.IWaveformDb;
import com.minres.scviewer.database.IWaveformEvent;
import com.minres.scviewer.database.RelationType;
import com.minres.scviewer.e4.application.Messages;

View File

@ -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() {
@SuppressWarnings("null")
@Override
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
} else if((e.stateMask&SWT.MOD1)!=0) { //Ctrl/Cmd
int zoomlevel = waveformPane.getZoomLevel();