diff --git a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java index c56add4..213f8f6 100644 --- a/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java +++ b/plugins/com.minres.scviewer.database.ui.swt/src/com/minres/scviewer/database/ui/swt/Constants.java @@ -13,10 +13,10 @@ public class Constants { public static final String CONTENT_PROVIDER_TAG = "TOOLTIP_CONTENT_PROVIDER"; public static final String HELP_PROVIDER_TAG = "TOOLTIP_HELP_PROVIDER"; - public static final DecimalFormat TIME_FORMAT_FS = 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_UMS = new DecimalFormat("#.0#####"); + public static final DecimalFormat TIME_FORMAT_FS = new DecimalFormat("#0"); + public static final DecimalFormat TIME_FORMAT_PS = new DecimalFormat("#0"); + public static final DecimalFormat TIME_FORMAT_NS = new DecimalFormat("#0.0##"); + public static final DecimalFormat TIME_FORMAT_UMS = new DecimalFormat("#0.0#####"); public static final long[] POWERS_OF_TEN = { 1L, 10L, 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 155bbd4..e7f4f27 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 @@ -109,20 +109,21 @@ public class ArrowPainter implements IPainter { protected void deriveGeom(Collection relations, List res, boolean useTarget) { for (ITxRelation iTxRelation : relations) { ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource(); - for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) { - if (waveCanvas.wave2painterMap.containsKey(iWaveform)) { - IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform); - if(painter!=null) { - int height = waveCanvas.styleProvider.getTrackHeight(); - Rectangle bb = new Rectangle( - (int) (otherTx.getBeginTime() / scaleFactor), - waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx), - (int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), - height); - res.add(new LinkEntry(bb, iTxRelation.getRelationType())); + if(otherTx!=null && otherTx.getBeginTime()>=0) + for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) { + if (waveCanvas.wave2painterMap.containsKey(iWaveform)) { + IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform); + if(painter!=null) { + int height = waveCanvas.styleProvider.getTrackHeight(); + Rectangle bb = new Rectangle( + (int) (otherTx.getBeginTime() / scaleFactor), + waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx), + (int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), + height); + res.add(new LinkEntry(bb, iTxRelation.getRelationType())); + } } } - } } } diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AbstractTransactionTreeContentProvider.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AbstractTransactionTreeContentProvider.java index ee9f230..6b7d13e 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AbstractTransactionTreeContentProvider.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AbstractTransactionTreeContentProvider.java @@ -73,9 +73,10 @@ public abstract class AbstractTransactionTreeContentProvider implements ITreeCon case OUT_REL: Vector res_out = new Vector<>(); for(ITxRelation rel:node.element.getOutgoingRelations()){ + ITx tgt = rel.getTarget(); res_out.add(new Object[]{ rel.getRelationType(), - rel.getTarget().getGenerator().getName(), + tgt.getBeginTime()<0?"":tgt.getGenerator().getName(), rel.getTarget()}); } return res_out.toArray(); diff --git a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java index 9daf7bf..44c2fa5 100644 --- a/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java +++ b/plugins/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/txTableTree/AttributeLabelProvider.java @@ -40,7 +40,7 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe public static final int TX_TIME=3; String showProp; - + public String getShowProp() { return showProp; } @@ -140,7 +140,10 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe Object o = elements[field]; if(o instanceof ITx) { ITx tx = (ITx)o; - return new StyledString(this.txToString(tx)+" ("+tx.getStream().getFullName()+")"); + if(tx.getBeginTime()<0) + return new StyledString(this.txToString(tx)); + else + return new StyledString(this.txToString(tx)+" ("+tx.getStream().getFullName()+")"); } else return new StyledString(o.toString()); } else if(element instanceof ITx){ @@ -168,8 +171,13 @@ public class AttributeLabelProvider extends LabelProvider implements IStyledLabe */ String txToString(ITx tx){ StringBuilder sb = new StringBuilder(); - sb.append("tx#").append(tx.getId()).append("[").append(timeToString(tx.getBeginTime())); //$NON-NLS-1$ //$NON-NLS-2$ - sb.append(" - ").append(timeToString(tx.getEndTime())).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ + sb.append("tx#").append(tx.getId()); + if(tx.getBeginTime()>=0 && tx.getEndTime()>=0) { + sb.append("[").append(timeToString(tx.getBeginTime())); //$NON-NLS-1$ //$NON-NLS-2$ + sb.append(" - ").append(timeToString(tx.getEndTime())).append("]"); //$NON-NLS-1$ //$NON-NLS-2$ + } else { + sb.append("[not visible]"); + } return sb.toString(); } diff --git a/releng/com.minres.scviewer.target/com.minres.scviewer.target.target b/releng/com.minres.scviewer.target/com.minres.scviewer.target.target index 0c36901..c97669c 100644 --- a/releng/com.minres.scviewer.target/com.minres.scviewer.target.target +++ b/releng/com.minres.scviewer.target/com.minres.scviewer.target.target @@ -28,7 +28,7 @@ - + diff --git a/tests/com.minres.scviewer.database.test/inputs/my_db.fst b/tests/com.minres.scviewer.database.test/inputs/my_db.fst index f028f98..cadf436 100644 Binary files a/tests/com.minres.scviewer.database.test/inputs/my_db.fst and b/tests/com.minres.scviewer.database.test/inputs/my_db.fst differ diff --git a/tests/com.minres.scviewer.database.test/inputs/my_db.ftr b/tests/com.minres.scviewer.database.test/inputs/my_db.ftr index d901cb5..a9e9b72 100644 Binary files a/tests/com.minres.scviewer.database.test/inputs/my_db.ftr and b/tests/com.minres.scviewer.database.test/inputs/my_db.ftr differ