fixes visual handling of Tx not yet being loaded
This commit is contained in:
parent
6f2f5a388c
commit
654cf3f9e5
@ -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,
|
||||
|
@ -109,20 +109,21 @@ public class ArrowPainter implements IPainter {
|
||||
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> 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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,9 +73,10 @@ public abstract class AbstractTransactionTreeContentProvider implements ITreeCon
|
||||
case OUT_REL:
|
||||
Vector<Object[] > 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();
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<repository location="http://download.eclipse.org/nebula/releases/latest"/>
|
||||
<unit id="org.eclipse.nebula.widgets.xviewer.feature.feature.group" version="1.1.0.202208171809"/>
|
||||
<unit id="org.eclipse.nebula.widgets.xviewer.feature.feature.group" version="0.0.0"/>
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<repository location="http://download.eclipse.org/collections/10.4.0/repository"/>
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user