fix compiler warnings

This commit is contained in:
Eyck Jentzsch 2020-03-13 22:25:42 +01:00
parent c76805d133
commit 306e20d14f
10 changed files with 3 additions and 18 deletions

View File

@ -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{

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -1,4 +1,3 @@
output.. = bin/
bin.includes = META-INF/,\ bin.includes = META-INF/,\
.,\ .,\
plugin.xml,\ 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 // 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) {

View File

@ -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;

View File

@ -301,7 +301,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
}); });
*/ */
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) {
/* /*