Fixed merge issues
This commit is contained in:
parent
6853484417
commit
4c7532ab84
|
@ -220,7 +220,7 @@
|
|||
</command>
|
||||
<command
|
||||
commandId="com.minres.scviewer.ui.zoom"
|
||||
label="1us"
|
||||
label="1µs"
|
||||
style="push"
|
||||
tooltip="Resolution 1us">
|
||||
<parameter
|
||||
|
@ -230,7 +230,7 @@
|
|||
</command>
|
||||
<command
|
||||
commandId="com.minres.scviewer.ui.zoom"
|
||||
label="10us"
|
||||
label="10µs"
|
||||
style="push"
|
||||
tooltip="Resolution 10us">
|
||||
<parameter
|
||||
|
@ -240,7 +240,7 @@
|
|||
</command>
|
||||
<command
|
||||
commandId="com.minres.scviewer.ui.zoom"
|
||||
label="100us"
|
||||
label="100µs"
|
||||
style="push"
|
||||
tooltip="Resolution 100us">
|
||||
<parameter
|
||||
|
|
|
@ -21,10 +21,13 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.action.IStatusLineManager;
|
||||
import org.eclipse.jface.action.StatusLineContributionItem;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.ui.IActionBars;
|
||||
import org.eclipse.ui.IEditorInput;
|
||||
import org.eclipse.ui.IEditorSite;
|
||||
import org.eclipse.ui.IFileEditorInput;
|
||||
|
@ -49,6 +52,13 @@ import com.minres.scviewer.ui.views.TxOutlinePage;
|
|||
|
||||
public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor {
|
||||
|
||||
private final static String[] zoomLevel={
|
||||
"1fs", "10fs", "100fs",
|
||||
"1ps", "10ps", "100ps",
|
||||
"1ns", "10ns", "100ns",
|
||||
"1µs", "10µs", "10µs",
|
||||
"1ms", "10ms", "100ms", "1s"};
|
||||
|
||||
public static final String ID = "com.minres.scviewer.ui.TxEditorPart"; //$NON-NLS-1$
|
||||
|
||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
||||
|
@ -60,6 +70,8 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
|||
|
||||
private Composite myParent;
|
||||
|
||||
private StatusLineContributionItem zoomStatusLineItem;
|
||||
|
||||
public TxEditorPart() {
|
||||
}
|
||||
|
||||
|
@ -97,6 +109,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
|||
}
|
||||
}
|
||||
}).run();
|
||||
zoomStatusLineItem.setText("Zoom level: "+zoomLevel[txDisplay.getZoomLevel()]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -257,6 +270,11 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
|||
// Initialize the editor part
|
||||
setSite(site);
|
||||
setInput(input);
|
||||
zoomStatusLineItem = new StatusLineContributionItem("TxEditorContributionItem");
|
||||
IActionBars actionBars = getEditorSite().getActionBars();
|
||||
IStatusLineManager manager = actionBars.getStatusLineManager();
|
||||
manager.add(zoomStatusLineItem);
|
||||
actionBars.updateActionBars();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,6 +50,7 @@ class StreamPainter implements IWaveformPainter{
|
|||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
if(stream.getEvents().size()==0) return;
|
||||
if(waveCanvas.currentWaveformSelection!=null && waveCanvas.currentWaveformSelection.getId()==stream.getId())
|
||||
gc.setBackground(this.waveCanvas.colors[WaveformCanvas.Colors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
else
|
||||
|
@ -58,12 +59,8 @@ class StreamPainter implements IWaveformPainter{
|
|||
gc.fillRectangle(area);
|
||||
Entry<Long, ?> firstTx=stream.getEvents().floorEntry(area.x*waveCanvas.getScaleFactor());
|
||||
Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry((area.x+area.width)*waveCanvas.getScaleFactor());
|
||||
if(firstTx==null){
|
||||
if(lastTx==null) return;
|
||||
firstTx = stream.getEvents().firstEntry();
|
||||
} else if(lastTx==null){
|
||||
lastTx=stream.getEvents().lastEntry();
|
||||
}
|
||||
if(firstTx==null) firstTx = stream.getEvents().firstEntry();
|
||||
if(lastTx==null) lastTx=stream.getEvents().lastEntry();
|
||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
gc.setLineStyle(SWT.LINE_SOLID);
|
||||
gc.setLineWidth(1);
|
||||
|
|
|
@ -14,12 +14,11 @@ import java.beans.PropertyChangeEvent;
|
|||
import java.beans.PropertyChangeListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.jface.resource.FontDescriptor;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||
|
@ -32,14 +31,11 @@ import org.eclipse.swt.custom.SashForm;
|
|||
import org.eclipse.swt.custom.ScrolledComposite;
|
||||
import org.eclipse.swt.events.ControlAdapter;
|
||||
import org.eclipse.swt.events.ControlEvent;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.FontData;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
@ -50,7 +46,6 @@ import org.eclipse.swt.layout.GridLayout;
|
|||
import org.eclipse.swt.widgets.Canvas;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
|
@ -121,6 +116,8 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
|
|||
|
||||
nameListScrolled = new ScrolledComposite(namePane, SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
nameListScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
||||
nameListScrolled.setExpandHorizontal(true);
|
||||
nameListScrolled.setExpandVertical(true);
|
||||
nameListScrolled.setAlwaysShowScrollBars(true);
|
||||
nameListScrolled.addControlListener(new ControlAdapter(){
|
||||
@Override
|
||||
|
@ -151,6 +148,8 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
|
|||
valuePane.setBackground(valuePane.getDisplay().getSystemColor( SWT.COLOR_WIDGET_BACKGROUND));
|
||||
valueListScrolled = new ScrolledComposite(valuePane, SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
valueListScrolled.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
||||
valueListScrolled.setExpandHorizontal(true);
|
||||
valueListScrolled.setExpandVertical(true);
|
||||
valueListScrolled.setAlwaysShowScrollBars(true);
|
||||
valueListScrolled.addControlListener(new ControlAdapter(){
|
||||
@Override
|
||||
|
@ -281,7 +280,9 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
|
|||
even=!even;
|
||||
}
|
||||
nameList.setSize(nameMaxWidth+15, yoffs);
|
||||
nameListScrolled.setMinSize(nameMaxWidth+15, yoffs);
|
||||
valueList.setSize(calculateValueWidth(), yoffs);
|
||||
valueListScrolled.setMinSize(calculateValueWidth(), yoffs);
|
||||
nameList.redraw();
|
||||
valueList.redraw();
|
||||
trackList.redraw();
|
||||
|
@ -415,6 +416,7 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
|
|||
|
||||
protected void paintNames(GC gc, Rectangle rect) {
|
||||
if(streams.size()>0){
|
||||
@SuppressWarnings("unchecked")
|
||||
IWaveform<? extends IWaveformEvent> wave = (IWaveform<? extends IWaveformEvent>) nameList.getData(SELECTION);
|
||||
Integer firstKey=trackVerticalOffset.floorKey(rect.y);
|
||||
if(firstKey==null) firstKey=trackVerticalOffset.firstKey();
|
||||
|
@ -464,9 +466,12 @@ public class TxDisplay implements PropertyChangeListener, ISelectionProvider, Mo
|
|||
|
||||
protected void drawTextFormat(GC gc, Rectangle subArea, int yOffset, String value, boolean highlite) {
|
||||
Point size = gc.textExtent(value);
|
||||
if(highlite)
|
||||
if(highlite){
|
||||
gc.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));
|
||||
gc.setForeground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION_TEXT));
|
||||
gc.fillRectangle(subArea.x, subArea.y+yOffset, subArea.width, subArea.height);
|
||||
gc.setFont(nameFontB);
|
||||
else
|
||||
}else
|
||||
gc.setFont(nameFont);
|
||||
gc.drawText(value, subArea.x+5, subArea.y + yOffset+(trackList.getTrackHeight()-size.y)/2, true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue