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,48 +110,23 @@ 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();
|
||||
Rectangle bb = createLinkEntry(otherTx, otherTx.getStream());
|
||||
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;
|
||||
}
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Rectangle createLinkEntry(ITx otherTx, IWaveform iWaveform) {
|
||||
if (waveCanvas.wave2painterMap.containsKey(iWaveform)) {
|
||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream());
|
||||
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) {
|
||||
int height = waveCanvas.styleProvider.getTrackHeight();
|
||||
return new Rectangle(
|
||||
(int) (otherTx.getBeginTime() / scaleFactor),
|
||||
waveCanvas.rulerHeight + painter.getVerticalOffset() + height * getConcurrencyIndex(otherTx),
|
||||
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor),
|
||||
height);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintArea(Projection proj, Rectangle clientRect) {
|
||||
yCtrlOffset = waveCanvas.styleProvider.getTrackHeight()/2;
|
||||
|
@ -1035,15 +1035,20 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
|
||||
boolean foundZoom=false;
|
||||
//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++){
|
||||
long scaleFactor = (long) Math.pow(10, level/2d);
|
||||
if(level%2==1) scaleFactor*=3;
|
||||
if(scaleFactor*clientAreaWidth >= maxTime) {
|
||||
setZoomLevel(level);
|
||||
foundZoom=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int magnitude_factor=1;
|
||||
for(int magnitude=0; magnitude<Constants.UNIT_STRING.length; magnitude++) {
|
||||
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) {
|
||||
setZoomLevel(level);
|
||||
foundZoom=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(foundZoom) break;
|
||||
magnitude_factor*=1000;
|
||||
}
|
||||
//if no zoom level is found, set biggest one available
|
||||
if(!foundZoom) setZoomLevel(Constants.UNIT_MULTIPLIER.length*Constants.UNIT_STRING.length-1);
|
||||
|
||||
|
@ -52,9 +52,7 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
if(tableEntries && inputElement instanceof IWaveformDb){
|
||||
return new Object[]{};
|
||||
}else if(inputElement instanceof IHierNode){
|
||||
if(inputElement instanceof IHierNode){
|
||||
// make a copy as the laoder might continue to add waveforms
|
||||
ArrayList<IHierNode> nodes = new ArrayList<>(((IHierNode)inputElement).getChildNodes());
|
||||
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
Block a user