apply UI fixes
* wrong arrow target of transaction * wrong zomm factor calculation for zoom fit * streams and waveforms not visible if at root level
This commit is contained in:
parent
caa37375c0
commit
78faab404c
|
@ -110,46 +110,21 @@ public class ArrowPainter implements IPainter {
|
||||||
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
|
protected void deriveGeom(Collection<ITxRelation> relations, List<LinkEntry> res, boolean useTarget) {
|
||||||
for (ITxRelation iTxRelation : relations) {
|
for (ITxRelation iTxRelation : relations) {
|
||||||
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
|
ITx otherTx = useTarget ? iTxRelation.getTarget() : iTxRelation.getSource();
|
||||||
Rectangle bb = createLinkEntry(otherTx, otherTx.getStream());
|
for(IWaveform iWaveform: new IWaveform[]{otherTx.getStream(), otherTx.getGenerator()}) {
|
||||||
if(bb!=null){
|
|
||||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
|
|
||||||
if(gen instanceof IWaveform) {
|
|
||||||
bb = createLinkEntry(otherTx, (IWaveform) gen);
|
|
||||||
if(bb!=null){
|
|
||||||
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Rectangle createLinkEntry(ITx otherTx, IWaveform iWaveform) {
|
|
||||||
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
||||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream());
|
IWaveformPainter painter = waveCanvas.wave2painterMap.get(iWaveform);
|
||||||
if(painter==null) {
|
|
||||||
for(IHierNode gen:otherTx.getStream().getChildNodes()) {
|
|
||||||
if(gen instanceof IWaveform) {
|
|
||||||
painter = waveCanvas.wave2painterMap.get(gen);
|
|
||||||
if(painter!=null)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(painter!=null) {
|
if(painter!=null) {
|
||||||
int height = waveCanvas.styleProvider.getTrackHeight();
|
int height = waveCanvas.styleProvider.getTrackHeight();
|
||||||
return new Rectangle(
|
Rectangle bb = new Rectangle(
|
||||||
(int) (otherTx.getBeginTime() / scaleFactor),
|
(int) (otherTx.getBeginTime() / scaleFactor),
|
||||||
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
|
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
|
||||||
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
|
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
|
||||||
height);
|
height);
|
||||||
|
res.add(new LinkEntry(bb, iTxRelation.getRelationType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1035,14 +1035,19 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
|
|
||||||
boolean foundZoom=false;
|
boolean foundZoom=false;
|
||||||
//try to find existing zoomlevel where scaleFactor*clientAreaWidth >= maxTime, if one is found set it as new zoomlevel
|
//try to find existing zoomlevel where scaleFactor*clientAreaWidth >= maxTime, if one is found set it as new zoomlevel
|
||||||
for (int level=0; level<Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length; level++){
|
int magnitude_factor=1;
|
||||||
long scaleFactor = (long) Math.pow(10, level/2d);
|
for(int magnitude=0; magnitude<Constants.UNIT_STRING.length; magnitude++) {
|
||||||
if(level%2==1) scaleFactor*=3;
|
for (int multiplier=0; multiplier<Constants.UNIT_MULTIPLIER.length; multiplier++){
|
||||||
|
int level = magnitude*Constants.UNIT_MULTIPLIER.length+multiplier;
|
||||||
|
long scaleFactor = Constants.UNIT_MULTIPLIER[multiplier]*magnitude_factor;
|
||||||
if(scaleFactor*clientAreaWidth >= maxTime) {
|
if(scaleFactor*clientAreaWidth >= maxTime) {
|
||||||
setZoomLevel(level);
|
setZoomLevel(level);
|
||||||
foundZoom=true;
|
foundZoom=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(foundZoom) break;
|
||||||
|
magnitude_factor*=1000;
|
||||||
}
|
}
|
||||||
//if no zoom level is found, set biggest one available
|
//if no zoom level is found, set biggest one available
|
||||||
if(!foundZoom) setZoomLevel(Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length-1);
|
if(!foundZoom) setZoomLevel(Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length-1);
|
||||||
|
|
|
@ -52,9 +52,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
if(tableEntries && inputElement instanceof IWaveformDb){
|
if(inputElement instanceof IHierNode){
|
||||||
return new Object[]{};
|
|
||||||
}else if(inputElement instanceof IHierNode){
|
|
||||||
// make a copy as the laoder might continue to add waveforms
|
// make a copy as the laoder might continue to add waveforms
|
||||||
ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes());
|
ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes());
|
||||||
return nodes.stream().filter(n ->
|
return nodes.stream().filter(n ->
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
MANIFEST-000045
|
|
|
@ -1 +0,0 @@
|
||||||
2018/11/03-15:38:59.715484 139851522529088Delete type=3 #1
|
|
Binary file not shown.
Loading…
Reference in New Issue