diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java index e7f4f27..990c9a2 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/internal/ArrowPainter.java @@ -84,7 +84,10 @@ public class ArrowPainter implements IPainter { private int getConcurrencyIndex(ITx tx) { IEvent[] eventList = tx.getStream().getEventsBeforeTime(tx.getBeginTime()); Optional res = Arrays.stream(eventList).map(e -> ((ITxEvent)e).getRowIndex()).findFirst(); - return res.isPresent()? res.get():0; + if(res.isPresent() && res.get()>0) { + return res.get(); + } else + return 0; } protected boolean calculateGeometries() { @@ -98,8 +101,10 @@ public class ArrowPainter implements IPainter { return true; } int laneHeight = painter.getHeight() / tx.getStream().getRowCount(); + int laneOffset = laneHeight * getConcurrencyIndex(tx); + int rulerHeight = waveCanvas.rulerHeight; txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor), - waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * getConcurrencyIndex(tx), + rulerHeight + painter.getVerticalOffset() + laneOffset, (int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight); deriveGeom(tx.getIncomingRelations(), iRect, false); deriveGeom(tx.getOutgoingRelations(), oRect, true); @@ -114,12 +119,13 @@ public class ArrowPainter implements IPainter { if (waveCanvas.wave2painterMap.containsKey(iWaveform)) { IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform); if(painter!=null) { - int height = waveCanvas.styleProvider.getTrackHeight(); + int laneHeight = waveCanvas.styleProvider.getTrackHeight(); + int laneOffset = laneHeight * getConcurrencyIndex(tx); Rectangle bb = new Rectangle( (int) (otherTx.getBeginTime() / scaleFactor), - waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx), + waveCanvas.rulerHeight + painter.getVerticalOffset() + laneOffset, (int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), - height); + laneHeight); res.add(new LinkEntry(bb, iTxRelation.getRelationType())); } } diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java index 1bfa169..3461777 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/TransactionList.java @@ -267,6 +267,7 @@ public class TransactionList extends Composite { .map(e -> new AttributeNameBean(e.getKey(), e.getValue())) .collect(Collectors.toList()); getDisplay().asyncExec(() -> { + if(tableViewer.getControl().isDisposed()) return; tableViewer.setInput(txList); attrNames.clear(); attrNames.addAll(newAttrNames); diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java index a0e5489..7c6ee2c 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java @@ -828,7 +828,18 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis if(Boolean.parseBoolean(state.get(SHOWN_WAVEFORM + i + WAVEFORM_SELECTED))) selectedTrackEntries.add(trackEntry); } else { - IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i)); + String name = state.get(SHOWN_WAVEFORM + i); + IWaveform waveform = database.getStreamByName(name); + if (waveform == null) { + int pos = name.lastIndexOf('.'); + waveform = database.getStreamByName(name.substring(0, pos)); + if(waveform!=null) { + List childs = waveform.getChildNodes(); + waveform = (IWaveform) childs.stream().filter(node -> name.substring(pos+1).equals(node.getName())) + .findAny() + .orElse(null); + } + } if (waveform != null) { TrackEntry trackEntry = waveformPane.addWaveform(waveform, -1); //check if t is selected