Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
fdbd6f8402 | |||
1dad204494 | |||
54661c51ce | |||
b34fe0d0ba | |||
868eceddc5 | |||
b642c396c7 | |||
f3d8e34ed0 | |||
401c760e01 | |||
5add0e385d | |||
2ba6822f2b | |||
54124d13bf | |||
5b949a9d37 | |||
9a9b25622c | |||
dd6a8669b1 | |||
b483897769 | |||
bd24c4dd05 | |||
664e99d09e | |||
675b2ed972 | |||
e6f19311b1 | |||
4a8034191c | |||
9d4e5bf636 | |||
cc9be70708 | |||
2dcc72f679 | |||
563b6e2b01 | |||
6161c0e0ec | |||
61c2102ab7 | |||
796a04b981 | |||
2a71ab94f5 | |||
923b89c038 | |||
3de6c9900c | |||
ef1f2a758a | |||
3e6d5bd33e | |||
26968b8521 | |||
611cfc7b46 | |||
8cb77a555b | |||
b4a7f032f5 | |||
62e0ec2008 | |||
f6cc12e8c3 | |||
b38b268fcb | |||
55a14edc9d | |||
b170fb3c2a |
1
.gitignore
vendored
@ -8,3 +8,4 @@ SCViewer.xcf
|
||||
SCViewer_1.png
|
||||
*.launch
|
||||
copyrightLog.txt
|
||||
/workspace
|
||||
|
@ -29,26 +29,12 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||
</url>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.codehaus.groovy" version="2.5.8" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.osgi"/>
|
||||
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.core.resources"/>
|
||||
<import plugin="org.eclipse.jface.text"/>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.ui.editors"/>
|
||||
<import plugin="org.eclipse.ui.ide"/>
|
||||
<import plugin="org.eclipse.ui.views.properties.tabbed"/>
|
||||
<import plugin="org.eclipse.swt"/>
|
||||
<import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jface"/>
|
||||
<import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.equinox.registry"/>
|
||||
<import plugin="org.codehaus.groovy" version="2.5.8" match="greaterOrEqual"/>
|
||||
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
@ -41,7 +41,6 @@
|
||||
<import plugin="org.eclipse.e4.ui.di" version="1.1.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.e4.core.contexts" version="1.4.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui"/>
|
||||
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.osgi.services" version="3.5.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.e4.core.services" version="2.0.0" match="greaterOrEqual"/>
|
||||
@ -51,17 +50,15 @@
|
||||
<import plugin="org.eclipse.equinox.preferences"/>
|
||||
<import plugin="org.eclipse.core.expressions"/>
|
||||
<import plugin="org.eclipse.e4.core.commands" version="0.11.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.e4.ui.workbench.addons.swt"/>
|
||||
<import plugin="com.opcoach.e4.preferences"/>
|
||||
<import plugin="org.eclipse.e4.core.di.extensions"/>
|
||||
<import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.10.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.core.resources" version="3.13.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.opcoach.e4.preferences.mainmenu" version="1.2.0" match="greaterOrEqual"/>
|
||||
<import feature="com.opcoach.e4.preferences.feature" version="1.3.0.202004072127"/>
|
||||
<import feature="org.eclipse.equinox.executable" version="3.8.700.v20200207-2156"/>
|
||||
<import feature="org.eclipse.equinox.sdk" version="3.20.100.v20200303-1901"/>
|
||||
<import feature="org.eclipse.sdk" version="4.15.0.v20200305-0155"/>
|
||||
<import feature="org.eclipse.rcptt.core" version="2.5.1.M3"/>
|
||||
<import plugin="org.eclipse.core.commands"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
@ -37,8 +37,8 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||
version="0.0.0"/>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.core.resources"/>
|
||||
@ -52,7 +52,6 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||
<import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jface"/>
|
||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
@ -17,12 +17,19 @@
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<plugin
|
||||
id="com.minres.scviewer.database.ui"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
<includes
|
||||
id="com.minres.scviewer.database.feature"
|
||||
version="0.0.0"/>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.eclipse.swt" version="3.103.1" match="greaterOrEqual"/>
|
||||
<import plugin="com.minres.scviewer.database" version="1.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jface"/>
|
||||
<import plugin="org.eclipse.equinox.registry"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.osgi"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
id="com.minres.scviewer.database.ui.swt"
|
||||
|
@ -4,4 +4,5 @@ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -98,4 +98,5 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: SWT widget
|
||||
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Bundle-Version: 2.3.1.qualifier
|
||||
Bundle-Vendor: MINRES Technologies GmbH
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
||||
@ -10,11 +10,21 @@ Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
||||
com.google.guava;bundle-version="15.0.0",
|
||||
org.eclipse.jface,
|
||||
org.eclipse.equinox.registry,
|
||||
com.minres.scviewer.database.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.osgi
|
||||
Export-Package: com.minres.scviewer.database.swt
|
||||
Export-Package: com.minres.scviewer.database.ui;
|
||||
uses:="org.eclipse.swt.events,
|
||||
org.eclipse.swt.graphics,
|
||||
org.eclipse.swt.widgets,
|
||||
com.minres.scviewer.database,
|
||||
org.eclipse.jface.viewers",
|
||||
com.minres.scviewer.database.ui.swt;
|
||||
uses:="org.osgi.framework,
|
||||
org.eclipse.core.runtime,
|
||||
com.minres.scviewer.database.ui,
|
||||
org.eclipse.swt.graphics,
|
||||
org.eclipse.swt.widgets"
|
||||
Bundle-ClassPath: .
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-Activator: com.minres.scviewer.database.swt.DatabaseUiPlugin
|
||||
Bundle-Activator: com.minres.scviewer.database.ui.swt.DatabaseUiPlugin
|
||||
Automatic-Module-Name: com.minres.scviewer.database.ui.swt
|
||||
|
@ -8,5 +8,5 @@
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.3.1-SNAPSHOT</version>
|
||||
</project>
|
||||
|
@ -25,7 +25,7 @@ import org.eclipse.swt.widgets.Control;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
|
||||
public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvider{
|
||||
public interface IWaveformView extends PropertyChangeListener, ISelectionProvider{
|
||||
|
||||
String CURSOR_PROPERTY = "cursor_time";
|
||||
|
||||
@ -51,7 +51,9 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
|
||||
|
||||
public void setSelection(ISelection selection);
|
||||
|
||||
public void setSelection(ISelection selection, boolean addIfNeeded);
|
||||
public void setSelection(ISelection selection, boolean showIfNeeded);
|
||||
|
||||
public void addToSelection(ISelection selection, boolean showIfNeeded);
|
||||
|
||||
public void moveSelection(GotoDirection direction);
|
||||
|
||||
@ -110,4 +112,6 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
|
||||
public void scrollHorizontal(int percent);
|
||||
|
||||
public void addDisposeListener( DisposeListener listener );
|
||||
|
||||
public void deleteSelectedTracks();
|
||||
}
|
@ -12,6 +12,6 @@ package com.minres.scviewer.database.ui;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
public interface IWaveformViewerFactory {
|
||||
public IWaveformViewer createPanel(Composite parent);
|
||||
public interface IWaveformViewFactory {
|
||||
public IWaveformView createPanel(Composite parent);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt;
|
||||
package com.minres.scviewer.database.ui.swt;
|
||||
|
||||
public class Constants {
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt;
|
||||
package com.minres.scviewer.database.ui.swt;
|
||||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Plugin;
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt;
|
||||
package com.minres.scviewer.database.ui.swt;
|
||||
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Composite;
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt;
|
||||
package com.minres.scviewer.database.ui.swt;
|
||||
|
||||
import org.eclipse.swt.widgets.Widget;
|
||||
|
@ -8,19 +8,19 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt;
|
||||
package com.minres.scviewer.database.ui.swt;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.minres.scviewer.database.swt.internal.WaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewerFactory;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewFactory;
|
||||
import com.minres.scviewer.database.ui.swt.internal.WaveformView;
|
||||
|
||||
public class WaveformViewerFactory implements IWaveformViewerFactory {
|
||||
public class WaveformViewFactory implements IWaveformViewFactory {
|
||||
|
||||
@Override
|
||||
public IWaveformViewer createPanel(Composite parent) {
|
||||
return new WaveformViewer(parent);
|
||||
public IWaveformView createPanel(Composite parent) {
|
||||
return new WaveformView(parent);
|
||||
}
|
||||
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
@ -49,7 +49,7 @@ public class ArrowPainter implements IPainter {
|
||||
|
||||
long scaleFactor;
|
||||
|
||||
boolean deferredUpdate;
|
||||
boolean deferUpdate;
|
||||
|
||||
public ArrowPainter(WaveformCanvas waveCanvas, RelationType relationType) {
|
||||
this.waveCanvas = waveCanvas;
|
||||
@ -80,12 +80,14 @@ public class ArrowPainter implements IPainter {
|
||||
}
|
||||
|
||||
protected void calculateGeometries() {
|
||||
deferredUpdate = false;
|
||||
deferUpdate = false;
|
||||
iRect.clear();
|
||||
oRect.clear();
|
||||
ITxStream<?> stream = tx.getStream();
|
||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(stream);
|
||||
if (painter == null) { // stream has been added but painter not yet
|
||||
// created
|
||||
deferredUpdate = true;
|
||||
deferUpdate = true;
|
||||
return;
|
||||
}
|
||||
int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
|
||||
@ -117,33 +119,27 @@ public class ArrowPainter implements IPainter {
|
||||
Color fgColor = waveCanvas.colors[WaveformColors.REL_ARROW.ordinal()];
|
||||
Color highliteColor = waveCanvas.colors[WaveformColors.REL_ARROW_HIGHLITE.ordinal()];
|
||||
|
||||
if (deferredUpdate || (tx != null && waveCanvas.getScaleFactor() != scaleFactor)) {
|
||||
if(tx==null) return;
|
||||
if (!deferUpdate) {
|
||||
scaleFactor = waveCanvas.getScaleFactor();
|
||||
calculateGeometries();
|
||||
}
|
||||
if(txRectangle == null) return;
|
||||
if(deferUpdate) return;
|
||||
int correctionValue = (int)(selectionOffset);
|
||||
Rectangle correctedTargetRectangle = new Rectangle(txRectangle.x+correctionValue, txRectangle.y, txRectangle.width, txRectangle.height);
|
||||
for (LinkEntry entry : iRect) {
|
||||
Rectangle correctedRectangle = new Rectangle(entry.rectangle.x+correctionValue, entry.rectangle.y, entry.rectangle.width, entry.rectangle.height);
|
||||
Point target = drawPath(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor,
|
||||
drawArrow(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor,
|
||||
correctedRectangle, correctedTargetRectangle);
|
||||
drawArrow(proj, target);
|
||||
}
|
||||
for (LinkEntry entry : oRect) {
|
||||
Rectangle correctedRectangle = new Rectangle(entry.rectangle.x+correctionValue, entry.rectangle.y, entry.rectangle.width, entry.rectangle.height);
|
||||
Point target = drawPath(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor, correctedTargetRectangle,
|
||||
drawArrow(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor, correctedTargetRectangle,
|
||||
correctedRectangle);
|
||||
drawArrow(proj, target);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawArrow(Projection proj, Point target) {
|
||||
proj.drawLine(target.x - 8, target.y - 5, target.x, target.y);
|
||||
proj.drawLine(target.x - 8, target.y + 5, target.x, target.y);
|
||||
}
|
||||
|
||||
protected Point drawPath(Projection proj, Color fgColor, Rectangle srcRectangle, Rectangle tgtRectangle) {
|
||||
protected void drawArrow(Projection proj, Color fgColor, Rectangle srcRectangle, Rectangle tgtRectangle) {
|
||||
Point point1 = proj.project(new Point(srcRectangle.x, srcRectangle.y + srcRectangle.height / 2));
|
||||
Point point2 = proj.project(new Point(tgtRectangle.x, tgtRectangle.y + tgtRectangle.height / 2));
|
||||
|
||||
@ -160,11 +156,15 @@ public class ArrowPainter implements IPainter {
|
||||
path.cubicTo(center.x + xCtrlOffset, center.y, point2.x - xCtrlOffset, point2.y, point2.x, point2.y);
|
||||
} else
|
||||
path.cubicTo(point1.x + xCtrlOffset, point1.y, point2.x - xCtrlOffset, point2.y, point2.x, point2.y);
|
||||
|
||||
proj.setAntialias(SWT.ON);
|
||||
proj.setForeground(fgColor);
|
||||
proj.getGC().drawPath(path);
|
||||
path.dispose();
|
||||
return point2;
|
||||
// now draw the arrow head
|
||||
proj.getGC().drawLine(point2.x - 8, point2.y - 5, point2.x, point2.y);
|
||||
proj.getGC().drawLine(point2.x - 8, point2.y + 5, point2.x, point2.y);
|
||||
|
||||
}
|
||||
|
||||
class LinkEntry {
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@ -44,10 +44,6 @@ public class Projection {
|
||||
public void setFillRule(int rule) {
|
||||
gc.setFillRule(rule);
|
||||
}
|
||||
public void fillRectangle(Rectangle rect) {
|
||||
gc.fillRectangle(rect.x+translation.x, rect.y+translation.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
public void setLineStyle(int style) {
|
||||
gc.setLineStyle(style);
|
||||
}
|
||||
@ -69,6 +65,10 @@ public class Projection {
|
||||
return gc;
|
||||
}
|
||||
|
||||
public void fillRectangle(Rectangle rect) {
|
||||
gc.fillRectangle(rect.x+translation.x, rect.y+translation.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
public void drawRectangle(Rectangle rect) {
|
||||
gc.drawRectangle(rect.x+translation.y, rect.y+translation.y, rect.width, rect.height);
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map.Entry;
|
||||
@ -249,7 +249,7 @@ public class SignalPainter extends TrackPainter {
|
||||
final boolean continous;
|
||||
private long minVal;
|
||||
private long range;
|
||||
|
||||
double yRange = (yOffsetB-yOffsetT);
|
||||
public MultiBitStencilAnalog(NavigableMap<Long, ?> entries, Object left, boolean continous, boolean signed) {
|
||||
this.continous=continous;
|
||||
Collection<?> values = ((NavigableMap<Long, ?>) entries).values();
|
||||
@ -276,8 +276,8 @@ public class SignalPainter extends TrackPainter {
|
||||
long leftVal = ((BitVector) left).toUnsignedValue();
|
||||
long rightVal= ((BitVector) right).toUnsignedValue();
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) * yRange / range);
|
||||
int yOffsetRight = (int) ((rightVal-minVal) * yRange / range);
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
@ -401,8 +401,8 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
} else {
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) * (yOffsetB-yOffsetT) / range);
|
||||
int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) * (yOffsetB-yOffsetT) / range);
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@ -135,9 +135,6 @@ public class StreamPainter extends TrackPainter{
|
||||
if(bb.x+bb.width<area.x || bb.x>area.x+area.width) return;
|
||||
if(bb.width==0){
|
||||
proj.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height);
|
||||
} else if(bb.width<10){
|
||||
proj.fillRectangle(bb);
|
||||
proj.drawRectangle(bb);
|
||||
} else {
|
||||
if(bb.x < area.x) {
|
||||
bb.width = bb.width-(area.x-bb.x)+5;
|
||||
@ -149,8 +146,9 @@ public class StreamPainter extends TrackPainter{
|
||||
bb_x2=area_x2+5;
|
||||
bb.width= bb_x2-bb.x;
|
||||
}
|
||||
proj.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
proj.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
int arc = bb.width<10?1:5;
|
||||
proj.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, arc, arc);
|
||||
proj.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, arc, arc);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
@ -13,9 +13,9 @@ import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Widget;
|
||||
|
||||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.swt.ToolTipContentProvider;
|
||||
import com.minres.scviewer.database.swt.ToolTipHelpTextProvider;
|
||||
import com.minres.scviewer.database.ui.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.swt.ToolTipContentProvider;
|
||||
import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider;
|
||||
|
||||
class ToolTipHandler {
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -25,6 +25,7 @@ import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
@ -39,15 +40,17 @@ import com.google.common.collect.Lists;
|
||||
import com.minres.scviewer.database.ITx;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
import com.minres.scviewer.database.ui.swt.Constants;
|
||||
|
||||
public class WaveformCanvas extends Canvas {
|
||||
|
||||
Color[] colors = new Color[WaveformColors.values().length];
|
||||
|
||||
private boolean doubleBuffering = true;
|
||||
|
||||
private int trackHeight = 50;
|
||||
|
||||
private long scaleFactor = 1000000L; // 1ns
|
||||
@ -108,10 +111,10 @@ public class WaveformCanvas extends Canvas {
|
||||
// order is important: it is bottom to top
|
||||
trackAreaPainter=new TrackAreaPainter(this);
|
||||
painterList.add(trackAreaPainter);
|
||||
arrowPainter=new ArrowPainter(this, IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
painterList.add(arrowPainter);
|
||||
rulerPainter=new RulerPainter(this);
|
||||
painterList.add(rulerPainter);
|
||||
arrowPainter=new ArrowPainter(this, IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
painterList.add(arrowPainter);
|
||||
CursorPainter cp = new CursorPainter(this, scaleFactor * 10, cursorPainters.size()-1);
|
||||
painterList.add(cp);
|
||||
cursorPainters.add(cp);
|
||||
@ -226,10 +229,10 @@ public class WaveformCanvas extends Canvas {
|
||||
}
|
||||
|
||||
public void setZoomLevel(int level, long centerTime) {
|
||||
//FIXME: keep center if zoom-out and cursor is not in view
|
||||
long oldScaleFactor=scaleFactor;
|
||||
if(level<0) level = 0;
|
||||
if(level<Constants.unitMultiplier.length*Constants.unitString.length){
|
||||
this.level = level;
|
||||
this.scaleFactor = (long) Math.pow(10, level/2);
|
||||
if(level%2==1) this.scaleFactor*=3;
|
||||
ITx tx = arrowPainter.getTx();
|
||||
@ -252,6 +255,7 @@ public class WaveformCanvas extends Canvas {
|
||||
syncScrollBars();
|
||||
arrowPainter.setTx(tx);
|
||||
redraw();
|
||||
this.level = level;
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,8 +401,20 @@ public class WaveformCanvas extends Canvas {
|
||||
|
||||
/* Paint function */
|
||||
private void paint(GC gc) {
|
||||
Point pt = getSize();
|
||||
if(pt.x==0 || pt.y==0) return;
|
||||
Rectangle clientRect = getClientArea(); /* Canvas' painting area */
|
||||
Projection p = new Projection(gc);
|
||||
GC thisGc = gc;
|
||||
Image d_backingImg = null;
|
||||
if(doubleBuffering) {
|
||||
d_backingImg = new Image(getDisplay(), pt.x, pt.y);
|
||||
thisGc = new GC(d_backingImg);
|
||||
thisGc.setBackground(gc.getBackground());
|
||||
thisGc.setForeground(gc.getForeground());
|
||||
thisGc.setFont(gc.getFont());
|
||||
|
||||
}
|
||||
Projection p = new Projection(thisGc);
|
||||
p.setTranslation(origin);
|
||||
if (painterList.size() > 0 ) {
|
||||
for (IPainter painter : painterList)
|
||||
@ -407,6 +423,11 @@ public class WaveformCanvas extends Canvas {
|
||||
gc.fillRectangle(clientRect);
|
||||
initScrollBars();
|
||||
}
|
||||
if(doubleBuffering) {
|
||||
gc.drawImage(d_backingImg, 0, 0);
|
||||
d_backingImg.dispose();
|
||||
thisGc.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Object> getElementsAt(Point point) {
|
@ -8,7 +8,7 @@
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
package com.minres.scviewer.database.ui.swt.internal;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
@ -52,7 +52,6 @@ import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.MouseMoveListener;
|
||||
import org.eclipse.swt.events.PaintEvent;
|
||||
import org.eclipse.swt.events.PaintListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
@ -86,14 +85,14 @@ import com.minres.scviewer.database.ITxRelation;
|
||||
import com.minres.scviewer.database.ITxStream;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.ICursor;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
import com.minres.scviewer.database.ui.swt.Constants;
|
||||
|
||||
public class WaveformViewer implements IWaveformViewer {
|
||||
public class WaveformView implements IWaveformView {
|
||||
|
||||
private ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<ISelectionChangedListener>();
|
||||
|
||||
@ -103,7 +102,7 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
|
||||
private ITx currentTxSelection;
|
||||
|
||||
private TrackEntry currentWaveformSelection;
|
||||
private ArrayList<TrackEntry> currentWaveformSelection = new ArrayList<>();
|
||||
|
||||
private ScrolledComposite nameListScrolled;
|
||||
|
||||
@ -133,51 +132,48 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
|
||||
private Font nameFont, nameFontB;
|
||||
|
||||
protected TrackEntry lastClickedEntry;
|
||||
|
||||
protected MouseListener nameValueMouseListener = new MouseAdapter() {
|
||||
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
if (e.button == 1) {
|
||||
Entry<Integer, TrackEntry> entry = trackVerticalOffset.floorEntry(e.y);
|
||||
if (entry != null)
|
||||
setSelection(new StructuredSelection(entry.getValue()));
|
||||
entry.getValue().selected=true;
|
||||
} else if (e.button == 3) {
|
||||
Menu topMenu= top.getMenu();
|
||||
if(topMenu!=null) topMenu.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseUp(MouseEvent e) {
|
||||
if (e.button == 1) {
|
||||
Entry<Integer, TrackEntry> entry = trackVerticalOffset.floorEntry(e.y);
|
||||
if (entry != null) {
|
||||
if((e.stateMask & SWT.SHIFT) != 0) {
|
||||
if(lastClickedEntry.selected) {
|
||||
int firstIdx=streams.indexOf(lastClickedEntry);
|
||||
int lastIdx = streams.indexOf(entry.getValue());
|
||||
List<TrackEntry> res = firstIdx>lastIdx?streams.subList(lastIdx, firstIdx+1):streams.subList(firstIdx, lastIdx+1);
|
||||
setSelection(new StructuredSelection(res), (e.stateMask & SWT.CTRL) !=0 , false);
|
||||
} else
|
||||
setSelection(new StructuredSelection(entry.getValue()), (e.stateMask & SWT.CTRL) !=0 , false);
|
||||
} else {
|
||||
setSelection(new StructuredSelection(entry.getValue()), (e.stateMask & SWT.CTRL) !=0 , false);
|
||||
}
|
||||
}
|
||||
lastClickedEntry = entry.getValue();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class WaveformMouseListener implements MouseMoveListener, MouseListener, PaintListener {
|
||||
class WaveformMouseListener implements PaintListener, Listener {
|
||||
Point start, end;
|
||||
List<Object> initialSelected;
|
||||
boolean down=false;
|
||||
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
start=new Point(e.x, e.y);
|
||||
end=new Point(e.x, e.y);
|
||||
down=true;
|
||||
if((e.stateMask&SWT.MODIFIER_MASK)!=0) return; //don't react on modifier
|
||||
if (e.button == 1) {
|
||||
initialSelected = waveformCanvas.getElementsAt(start);
|
||||
} else if (e.button == 3) {
|
||||
Menu topMenu= top.getMenu();
|
||||
if(topMenu!=null) topMenu.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseMove(MouseEvent e) {
|
||||
if(down) {
|
||||
end=new Point(e.x, e.y);
|
||||
asyncUpdate(e.widget);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintControl(PaintEvent e) {
|
||||
if(down) {
|
||||
@ -185,15 +181,13 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
gc.setAlpha(128);
|
||||
int minX = Math.min(start.x, end.x);
|
||||
int width = Math.max(start.x, end.x) - minX;
|
||||
Point origin = waveformCanvas.getOrigin();
|
||||
int y_top = waveformCanvas.getRulerHeight()- origin.y;
|
||||
int y_top = waveformCanvas.getRulerHeight();
|
||||
int y_bottom = waveformCanvas.getSize().y;
|
||||
gc.fillRectangle(minX, y_top, width,y_bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseUp(MouseEvent e) {
|
||||
private void mouseUp(MouseEvent e) {
|
||||
down=false;
|
||||
if(start==null) return;
|
||||
if((e.stateMask&SWT.MODIFIER_MASK&~SWT.SHIFT)!=0) return; //don't react on modifier except shift
|
||||
@ -285,10 +279,45 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
return time;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event e) {
|
||||
switch (e.type) {
|
||||
case SWT.MouseWheel:
|
||||
break;
|
||||
case SWT.MouseDown:
|
||||
start=new Point(e.x, e.y);
|
||||
end=new Point(e.x, e.y);
|
||||
down=true;
|
||||
if((e.stateMask&SWT.MODIFIER_MASK)!=0) return; //don't react on modifier
|
||||
if (e.button == 1) {
|
||||
initialSelected = waveformCanvas.getElementsAt(start);
|
||||
} else if (e.button == 3) {
|
||||
Menu topMenu= top.getMenu();
|
||||
if(topMenu!=null) topMenu.setVisible(true);
|
||||
}
|
||||
break;
|
||||
case SWT.MouseUp:
|
||||
mouseUp(new MouseEvent(e));
|
||||
break;
|
||||
//case SWT.MouseDoubleClick:
|
||||
//mouseDoubleClick(new MouseEvent(e));
|
||||
//break;
|
||||
case SWT.MouseMove:
|
||||
if(down) {
|
||||
end=new Point(e.x, e.y);
|
||||
asyncUpdate(e.widget);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
protected WaveformMouseListener waveformMouseListener = new WaveformMouseListener();
|
||||
|
||||
public WaveformViewer(Composite parent) {
|
||||
public WaveformView(Composite parent) {
|
||||
pcs=new PropertyChangeSupport(this);
|
||||
|
||||
trackVerticalOffset = new TreeMap<Integer, TrackEntry>();
|
||||
@ -300,7 +329,7 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
streams = new ObservableList<>();
|
||||
streams.addPropertyChangeListener("content", this);
|
||||
|
||||
top = new Composite(parent, SWT.NONE);
|
||||
top = parent;
|
||||
top.setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
|
||||
SashForm topSash = new SashForm(top, SWT.SMOOTH);
|
||||
@ -385,9 +414,12 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
valueListScrolled.setContent(valueList);
|
||||
|
||||
waveformCanvas.setMaxTime(1);
|
||||
waveformCanvas.addMouseListener(waveformMouseListener);
|
||||
waveformCanvas.addMouseMoveListener(waveformMouseListener);
|
||||
waveformCanvas.addPaintListener(waveformMouseListener);
|
||||
waveformCanvas.addListener(SWT.MouseDown,waveformMouseListener);
|
||||
waveformCanvas.addListener(SWT.MouseUp,waveformMouseListener);
|
||||
//waveformCanvas.addListener(SWT.MouseDoubleClick,waveformMouseListener);
|
||||
waveformCanvas.addListener(SWT.MouseMove,waveformMouseListener);
|
||||
waveformCanvas.addListener(SWT.MouseWheel, waveformMouseListener);
|
||||
|
||||
nameListScrolled.getVerticalBar().addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
@ -458,7 +490,7 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
@Override
|
||||
public void run() {
|
||||
update();
|
||||
waveformCanvas.reveal(currentWaveformSelection.waveform);
|
||||
currentWaveformSelection.stream().forEach(e -> waveformCanvas.reveal(e.waveform));
|
||||
valueList.redraw();
|
||||
nameList.redraw();
|
||||
}
|
||||
@ -481,13 +513,11 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
trackVerticalOffset.clear();
|
||||
waveformCanvas.clearAllWaveformPainter(false);
|
||||
boolean even = true;
|
||||
boolean clearSelection = true;
|
||||
TextLayout tl = new TextLayout(waveformCanvas.getDisplay());
|
||||
tl.setFont(nameFontB);
|
||||
for (TrackEntry streamEntry : streams) {
|
||||
streamEntry.height = waveformCanvas.getTrackHeight();
|
||||
streamEntry.vOffset=trackVerticalHeight;
|
||||
clearSelection &= currentWaveformSelection!=null && (streamEntry.waveform != currentWaveformSelection.waveform);
|
||||
if (streamEntry.isStream()) {
|
||||
streamEntry.currentValue="";
|
||||
streamEntry.height *= streamEntry.getStream().getMaxConcurrency();
|
||||
@ -513,7 +543,6 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
if (trackVerticalOffset.isEmpty()){
|
||||
waveformCanvas.setOrigin(0, 0);
|
||||
}
|
||||
if(clearSelection) setSelection(new StructuredSelection());
|
||||
}
|
||||
|
||||
private int calculateValueWidth() {
|
||||
@ -652,11 +681,12 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
@Override
|
||||
public ISelection getSelection() {
|
||||
if (currentTxSelection != null) {
|
||||
Object[] elem = {currentTxSelection, currentWaveformSelection};
|
||||
return new StructuredSelection(elem);
|
||||
} else if (currentWaveformSelection != null) {
|
||||
Object[] elem = {currentWaveformSelection.waveform, currentWaveformSelection};
|
||||
return new StructuredSelection(elem);
|
||||
ArrayList<Object> sel = new ArrayList<>();
|
||||
sel.add(currentTxSelection);
|
||||
sel.addAll(currentWaveformSelection.stream().map(e -> e.waveform).collect(Collectors.toList()));
|
||||
return new StructuredSelection(sel.toArray());
|
||||
} else if (currentWaveformSelection.size()>0) {
|
||||
return new StructuredSelection(currentWaveformSelection.toArray());
|
||||
} else
|
||||
return new StructuredSelection();
|
||||
}
|
||||
@ -666,22 +696,33 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
*/
|
||||
@Override
|
||||
public void setSelection(ISelection selection) {
|
||||
setSelection(selection, false);
|
||||
setSelection(selection, false, false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setSelection(ISelection selection, boolean addIfNeeded) {
|
||||
public void setSelection(ISelection selection, boolean showIfNeeded) {
|
||||
setSelection(selection, false, showIfNeeded);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#addToSelection(org.eclipse.jface.viewers.ISelection, boolean)
|
||||
*/
|
||||
@Override
|
||||
public void addToSelection(ISelection selection, boolean showIfNeeded) {
|
||||
setSelection(selection, true, showIfNeeded);
|
||||
}
|
||||
|
||||
public void setSelection(ISelection selection, boolean add, boolean addIfNeeded) {
|
||||
boolean selectionChanged = false;
|
||||
if(currentWaveformSelection!=null) currentWaveformSelection.selected=false;
|
||||
currentWaveformSelection.forEach(e->e.selected=false);
|
||||
if (selection instanceof IStructuredSelection) {
|
||||
if(((IStructuredSelection) selection).size()==0){
|
||||
selectionChanged = currentTxSelection!=null||currentWaveformSelection!=null;
|
||||
currentTxSelection = null;
|
||||
currentWaveformSelection = null;
|
||||
currentWaveformSelection .clear();
|
||||
} else {
|
||||
if(!add) currentWaveformSelection.clear();
|
||||
for(Object sel:((IStructuredSelection) selection).toArray()){
|
||||
if (sel instanceof ITx && currentTxSelection != sel){
|
||||
ITx txSel = (ITx) sel;
|
||||
@ -694,26 +735,27 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
streams.add(trackEntry);
|
||||
}
|
||||
currentTxSelection = txSel;
|
||||
if(trackEntry!=null) currentWaveformSelection = trackEntry;
|
||||
// if(trackEntry!=null) {
|
||||
// currentWaveformSelection.add((TrackEntry)sel);
|
||||
// }
|
||||
selectionChanged = true;
|
||||
} else if (sel instanceof TrackEntry && currentWaveformSelection != sel) {
|
||||
currentWaveformSelection = (TrackEntry) sel;
|
||||
if(currentTxSelection!=null && currentTxSelection.getStream()!=currentWaveformSelection)
|
||||
} else if (sel instanceof TrackEntry && !currentWaveformSelection.contains(sel)) {
|
||||
currentWaveformSelection.add((TrackEntry)sel);
|
||||
if(currentTxSelection!=null && !selectionChanged)
|
||||
currentTxSelection=null;
|
||||
|
||||
selectionChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (currentTxSelection != null || currentWaveformSelection != null)
|
||||
if (currentTxSelection != null || currentWaveformSelection.size() > 0)
|
||||
selectionChanged = true;
|
||||
currentTxSelection = null;
|
||||
currentWaveformSelection = null;
|
||||
currentWaveformSelection.clear();
|
||||
}
|
||||
if(currentWaveformSelection!=null) currentWaveformSelection.selected=true;
|
||||
currentWaveformSelection.forEach(e -> e.selected = true);
|
||||
if (selectionChanged) {
|
||||
if(currentWaveformSelection!=null) waveformCanvas.reveal(currentWaveformSelection.waveform);
|
||||
currentWaveformSelection.forEach(e -> waveformCanvas.reveal(e.waveform));
|
||||
waveformCanvas.setSelected(currentTxSelection);
|
||||
valueList.redraw();
|
||||
nameList.redraw();
|
||||
@ -723,9 +765,7 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
|
||||
protected void fireSelectionChanged() {
|
||||
if(currentWaveformSelection==null) return;
|
||||
IStructuredSelection selection=currentTxSelection!=null?
|
||||
new StructuredSelection(new Object[]{currentTxSelection, currentWaveformSelection.waveform}):
|
||||
new StructuredSelection(currentWaveformSelection.waveform);
|
||||
ISelection selection=getSelection();
|
||||
Object[] list = selectionChangedListeners.getListeners();
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection));
|
||||
@ -740,7 +780,8 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
if(direction==GotoDirection.NEXT || direction==GotoDirection.PREV)
|
||||
moveSelection(direction, NEXT_PREV_IN_STREAM) ;
|
||||
else {
|
||||
int idx = streams.indexOf(currentWaveformSelection);
|
||||
if(currentWaveformSelection.size()==1) {
|
||||
int idx = streams.indexOf(currentWaveformSelection.get(0));
|
||||
if(direction==GotoDirection.UP && idx>0) {
|
||||
setSelection(new StructuredSelection(streams.get(idx-1)));
|
||||
} else if(direction==GotoDirection.DOWN && idx<(streams.size()-1)) {
|
||||
@ -748,15 +789,22 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelection(com.minres.scviewer.database.swt.GotoDirection, com.minres.scviewer.database.RelationType)
|
||||
*/
|
||||
@Override
|
||||
public void moveSelection(GotoDirection direction, RelationType relationType) {
|
||||
if (currentWaveformSelection!=null && currentWaveformSelection.isStream() && currentTxSelection!=null) {
|
||||
if(relationType.equals(IWaveformViewer.NEXT_PREV_IN_STREAM)){
|
||||
ITxStream<? extends ITxEvent> stream = currentWaveformSelection.getStream();
|
||||
TrackEntry selectedWaveform=null;
|
||||
if(currentTxSelection!=null)
|
||||
selectedWaveform = getEntryForStream(currentTxSelection.getStream());
|
||||
else if(currentWaveformSelection.size()!=1) return;
|
||||
if(selectedWaveform==null)
|
||||
selectedWaveform = currentWaveformSelection.get(1);
|
||||
if (selectedWaveform!=null && selectedWaveform.isStream() && currentTxSelection!=null) {
|
||||
if(relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)){
|
||||
ITxStream<? extends ITxEvent> stream = selectedWaveform.getStream();
|
||||
ITx transaction = null;
|
||||
if (direction == GotoDirection.NEXT) {
|
||||
List<ITxEvent> thisEntryList = stream.getEvents().get(currentTxSelection.getBeginTime());
|
||||
@ -856,14 +904,14 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
*/
|
||||
@Override
|
||||
public void moveCursor(GotoDirection direction) {
|
||||
if(currentWaveformSelection.size()!=1) return;
|
||||
TrackEntry sel = currentWaveformSelection.get(0);
|
||||
long time = getCursorTime();
|
||||
NavigableMap<Long, ?> map=null;
|
||||
if(currentWaveformSelection!=null) {
|
||||
if(currentWaveformSelection.isStream()){
|
||||
map=currentWaveformSelection.getStream().getEvents();
|
||||
} else if(currentWaveformSelection.isSignal()){
|
||||
map=currentWaveformSelection.getSignal().getEvents();
|
||||
}
|
||||
if(sel.isStream()){
|
||||
map=sel.getStream().getEvents();
|
||||
} else if(sel.isSignal()){
|
||||
map=sel.getSignal().getEvents();
|
||||
}
|
||||
if(map!=null){
|
||||
Entry<Long, ?> entry=direction==GotoDirection.PREV?map.lowerEntry(time):map.higherEntry(time);
|
||||
@ -885,29 +933,37 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
public List<TrackEntry> getStreamList() {
|
||||
return streams;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#deleteSelectedTracks()
|
||||
*/
|
||||
@Override
|
||||
public void deleteSelectedTracks() {
|
||||
List<TrackEntry> streams = getStreamList();
|
||||
for (Object o : (IStructuredSelection)getSelection()) {
|
||||
if(o instanceof TrackEntry) {
|
||||
TrackEntry e = (TrackEntry) o;
|
||||
e.selected=false;
|
||||
streams.remove(e);
|
||||
}
|
||||
}
|
||||
setSelection(new StructuredSelection());
|
||||
update();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelected(int)
|
||||
*/
|
||||
@Override
|
||||
public void moveSelectedTrack(int i) {
|
||||
if(currentWaveformSelection!=null){
|
||||
int idx = streams.indexOf(currentWaveformSelection);
|
||||
int newIdx=idx+i;
|
||||
if(newIdx>=0 && newIdx<streams.size()){
|
||||
Collections.swap(streams,idx,newIdx);
|
||||
revealSelected=true;
|
||||
// update();
|
||||
// ITx selectedTx=currentTxSelection;
|
||||
// if(selectedTx!=null){
|
||||
// setSelection(new StructuredSelection(new Object[]{selectedTx, currentWaveformSelection.waveform}));
|
||||
// } else {
|
||||
// setSelection(new StructuredSelection(currentWaveformSelection.waveform));
|
||||
// }
|
||||
// waveformCanvas.reveal(currentWaveformSelection.waveform);
|
||||
// valueList.redraw();
|
||||
// nameList.redraw();
|
||||
}
|
||||
if(currentWaveformSelection.size()>0){
|
||||
int idx = streams.indexOf(currentWaveformSelection.get(0));
|
||||
for(Object o: currentWaveformSelection)
|
||||
streams.remove(o);
|
||||
int tgtIdx=idx+i;
|
||||
if(tgtIdx<0) tgtIdx=0;
|
||||
if(tgtIdx>=streams.size())
|
||||
streams.addAll(currentWaveformSelection);
|
||||
else
|
||||
streams.addAll(tgtIdx, currentWaveformSelection);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1109,38 +1165,30 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
dropTarget.setTransfer(types);
|
||||
|
||||
dropTarget.addDropListener(new DropTargetAdapter() {
|
||||
@SuppressWarnings("unchecked")
|
||||
public void drop(DropTargetEvent event) {
|
||||
if (LocalSelectionTransfer.getTransfer().isSupportedType(event.currentDataType)){
|
||||
ISelection sel = LocalSelectionTransfer.getTransfer().getSelection();
|
||||
if(sel!=null && sel instanceof IStructuredSelection){
|
||||
Object source = ((IStructuredSelection)sel).getFirstElement();
|
||||
ISelection s = LocalSelectionTransfer.getTransfer().getSelection();
|
||||
if(s!=null && s instanceof IStructuredSelection){
|
||||
IStructuredSelection sel = (IStructuredSelection) s;
|
||||
for(Object o: sel.toList())
|
||||
streams.remove(o);
|
||||
DropTarget tgt = (DropTarget) event.widget;
|
||||
Point dropPoint = ((Canvas) tgt.getControl()).toControl(event.x, event.y);
|
||||
Object target = trackVerticalOffset.floorEntry(dropPoint.y).getValue();
|
||||
if(source instanceof TrackEntry && target instanceof TrackEntry){
|
||||
TrackEntry srcWave=(TrackEntry) source;
|
||||
int srcIdx=streams.indexOf(srcWave);
|
||||
streams.remove(srcWave);
|
||||
// extract all elements being selected
|
||||
if( dropPoint.y > trackVerticalOffset.lastKey()) {
|
||||
streams.addAll(sel.toList());
|
||||
} else {
|
||||
TrackEntry target = trackVerticalOffset.floorEntry(dropPoint.y).getValue();
|
||||
int tgtIdx=streams.indexOf(target);
|
||||
if(srcIdx<=tgtIdx) tgtIdx++;
|
||||
if(tgtIdx>=streams.size())
|
||||
streams.add(srcWave);
|
||||
else
|
||||
streams.add(tgtIdx, srcWave);
|
||||
currentWaveformSelection=srcWave;
|
||||
update();
|
||||
} else if(source instanceof CursorPainter){
|
||||
((CursorPainter)source).setTime(0);
|
||||
updateValueList();
|
||||
streams.addAll(tgtIdx, sel.toList());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void dropAccept(DropTargetEvent event) {
|
||||
Point offset = canvas.toControl(event.x, event.y);
|
||||
if (event.detail != DND.DROP_MOVE || offset.y > trackVerticalOffset.lastKey() + waveformCanvas.getTrackHeight()) {
|
||||
if (event.detail != DND.DROP_MOVE) {
|
||||
event.detail = DND.DROP_NONE;
|
||||
}
|
||||
}
|
||||
@ -1351,4 +1399,5 @@ public class WaveformViewer implements IWaveformViewer {
|
||||
public void addDisposeListener( DisposeListener listener ) {
|
||||
waveformCanvas.addDisposeListener(listener);
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.minres.scviewer.database.ui</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -1,7 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
@ -1,3 +0,0 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
@ -1,12 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Database UI
|
||||
Bundle-SymbolicName: com.minres.scviewer.database.ui
|
||||
Bundle-Version: 2.0.0.qualifier
|
||||
Bundle-Vendor: MINRES Technologies GmbH
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: com.minres.scviewer.database.ui
|
||||
Require-Bundle: com.minres.scviewer.database,
|
||||
org.eclipse.jface,
|
||||
org.eclipse.swt
|
||||
Automatic-Module-Name: com.minres.scviewer.database.ui
|
@ -1,4 +0,0 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
@ -1,12 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>com.minres.scviewer.database.ui</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
</project>
|
@ -4,4 +4,5 @@ org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -1,3 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
pluginProject.extensions=false
|
||||
resolve.requirebundle=false
|
||||
|
@ -3,41 +3,16 @@
|
||||
<children xsi:type="basic:TrimmedWindow" xmi:id="_95PfsXNmEeWBq8z1Dv39LA" label="SC Viewer" bindingContexts="_95PfunNmEeWBq8z1Dv39LA" width="1280" height="700">
|
||||
<children xsi:type="advanced:PerspectiveStack" xmi:id="_95QGxnNmEeWBq8z1Dv39LA">
|
||||
<children xsi:type="advanced:Perspective" xmi:id="_95QGx3NmEeWBq8z1Dv39LA">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_95QGyHNmEeWBq8z1Dv39LA" horizontal="true">
|
||||
<children xsi:type="basic:Part" xmi:id="_95QGynNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.parts.DesignBrowser" containerData="2000" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.DesignBrowser" label="Design Browser" bindingContexts="_iQ3kQGVmEeqSQM-A6dw9ig">
|
||||
<handlers xmi:id="_JIWOYIq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handler.addWaveformCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.AddWaveformHandler" command="_2PehEHr9EeWVM_sKoXvptg"/>
|
||||
<menus xsi:type="menu:PopupMenu" xmi:id="_HvUl8Iq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parts.DesignBrowser.popupmenu">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_HvUl8Yq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handledmenuitem.append" label="Append after" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/append_wave.png" command="_2PehEHr9EeWVM_sKoXvptg">
|
||||
<parameters xmi:id="_HvUl8oq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.21" name="com.minres.scviewer.e4.application.command.addwaveform.where" value="after"/>
|
||||
<parameters xmi:id="_HvUl84q-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.25" name="com.minres.scviewer.e4.application.command.addwaveform.all" value="false"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_HvUl9Iq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handledmenuitem.insertbefore" label="Insert before" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/insert_wave.png" command="_2PehEHr9EeWVM_sKoXvptg">
|
||||
<parameters xmi:id="_HvUl9Yq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.22" name="com.minres.scviewer.e4.application.command.addwaveform.where" value="before"/>
|
||||
<parameters xmi:id="_HvUl9oq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.26" name="com.minres.scviewer.e4.application.command.addwaveform.all" value="false"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_HvUl94q-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handledmenuitem.appendall" label="Append all" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/append_all_waves.png" command="_2PehEHr9EeWVM_sKoXvptg">
|
||||
<parameters xmi:id="_HvUl-Iq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.23" name="com.minres.scviewer.e4.application.command.addwaveform.where" value="after"/>
|
||||
<parameters xmi:id="_HvUl-Yq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.27" name="com.minres.scviewer.e4.application.command.addwaveform.all" value="true"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_HvUl-oq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handledmenuitem.insertall" label="Insert All" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/insert_all_waves.png" command="_2PehEHr9EeWVM_sKoXvptg">
|
||||
<parameters xmi:id="_HvUl-4q-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.24" name="com.minres.scviewer.e4.application.command.addwaveform.where" value="before"/>
|
||||
<parameters xmi:id="_HvUl_Iq-EeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.parameter.28" name="com.minres.scviewer.e4.application.command.addwaveform.all" value="true"/>
|
||||
</children>
|
||||
</menus>
|
||||
</children>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_uT9BIHgtEeWwZ-9vrAR2UQ" elementId="" containerData="8000">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_95QGyXNmEeWBq8z1Dv39LA" elementId="org.eclipse.editorss" containerData="7500">
|
||||
<tags>NoAutoCollapse</tags>
|
||||
</children>
|
||||
<children xsi:type="basic:Part" xmi:id="_vtfm8HgtEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parts.WaveformDetails" containerData="2500" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.TransactionDetails" label="Waveform Details"/>
|
||||
</children>
|
||||
</children>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:Part" xmi:id="__VNlAIytEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.dialog.aboutscviewer" toBeRendered="false" visible="false" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.AboutDialog" label="About SCViewer" bindingContexts="_95Pfu3NmEeWBq8z1Dv39LA"/>
|
||||
<mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
|
||||
<children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" mnemonics="M1+O" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_igsK0BkREeudD5MqrWoETQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" mnemonics="M1+O" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Re-load Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/database_refresh.png" mnemonics="M1+R" command="_srACsBkREeudD5MqrWoETQ"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_e7MOYJedEeW09eyIbHsdvg" elementId="" label="Load active tab settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
||||
<parameters xmi:id="_4vtYgJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.30" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
|
||||
</children>
|
||||
@ -84,7 +59,8 @@
|
||||
</mainMenu>
|
||||
<trimBars xmi:id="_95QGy3NmEeWBq8z1Dv39LA" elementId="org.eclipse.ui.main.toolbar">
|
||||
<children xsi:type="menu:ToolBar" xmi:id="_95QGzHNmEeWBq8z1Dv39LA" elementId="toolbar:org.eclipse.ui.main.toolbar">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_95QGzXNmEeWBq8z1Dv39LA" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" tooltip="Open new database" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_ZSajwBkZEeudD5MqrWoETQ" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" tooltip="Open new database" command="_95PfwHNmEeWBq8z1Dv39LA"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_95QGzXNmEeWBq8z1Dv39LA" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/database_refresh.png" tooltip="Re-load database" command="_srACsBkREeudD5MqrWoETQ"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_o9UBUJeiEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.handledtoolitem.loadsettings" label="Load settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
|
||||
<parameters xmi:id="_tQZAEJeiEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.32" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
|
||||
</children>
|
||||
@ -159,6 +135,7 @@
|
||||
<handlers xmi:id="_V4EscIuGEeWid7xO48ZBXw" elementId="com.minres.scviewer.e4.application.handler.setreleationtype" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.SetRelationTypeHandler" command="_E9lUgIt2EeWid7xO48ZBXw"/>
|
||||
<handlers xmi:id="__99WoJebEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.handler.loadStoreSettings" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.LoadStoreSettingsHandler" command="_7-AIMJebEeW09eyIbHsdvg"/>
|
||||
<handlers xmi:id="_x4pSEGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.handler.0" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.EnableHover" command="_uyeyYGtTEeqmlpoaaMHoiw"/>
|
||||
<handlers xmi:id="_h3jU8BkWEeudD5MqrWoETQ" elementId="com.minres.scviewer.e4.application.handler.reloadCommand" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.handlers.ReloadHandler" command="_srACsBkREeudD5MqrWoETQ"/>
|
||||
<bindingTables xmi:id="_95PfvnNmEeWBq8z1Dv39LA" bindingContext="_95PfuXNmEeWBq8z1Dv39LA">
|
||||
<bindings xmi:id="_95Pfv3NmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.keybinding.quit" keySequence="M1+Q" command="_95PfvHNmEeWBq8z1Dv39LA">
|
||||
<tags>type:user</tags>
|
||||
@ -290,6 +267,7 @@
|
||||
<parameters xmi:id="_4C_asc3ZEei6rfTGo88R-w" elementId="com.minres.scviewer.e4.application.commandparameter.changevaluedisplay" name="Type" optional="false"/>
|
||||
</commands>
|
||||
<commands xmi:id="_uyeyYGtTEeqmlpoaaMHoiw" elementId="com.minres.scviewer.e4.application.command.enablehover" commandName="Enable hover" description="Enable hover window in waveform"/>
|
||||
<commands xmi:id="_srACsBkREeudD5MqrWoETQ" elementId="com.minres.scviewer.e4.application.reload" commandName="Reload Command"/>
|
||||
<addons xmi:id="_95PfsnNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
|
||||
<addons xmi:id="_95Pfs3NmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
|
||||
<addons xmi:id="_95PftHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="bundleclass://org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
|
||||
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||
Bundle-Version: 2.6.1.qualifier
|
||||
Bundle-Version: 2.8.1.qualifier
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||
@ -15,7 +15,6 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.e4.ui.di;bundle-version="1.1.0",
|
||||
org.eclipse.e4.core.contexts;bundle-version="1.4.0",
|
||||
com.minres.scviewer.database.ui.swt;bundle-version="1.0.0",
|
||||
com.minres.scviewer.database.ui,
|
||||
com.minres.scviewer.database;bundle-version="1.0.0",
|
||||
org.eclipse.osgi.services;bundle-version="3.5.0",
|
||||
org.eclipse.e4.core.services;bundle-version="2.0.0",
|
||||
@ -29,7 +28,8 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
com.opcoach.e4.preferences,
|
||||
org.eclipse.e4.core.di.extensions,
|
||||
org.eclipse.e4.ui.css.swt.theme;bundle-version="0.10.0",
|
||||
org.eclipse.core.resources;bundle-version="3.13.0"
|
||||
org.eclipse.core.resources;bundle-version="3.13.0",
|
||||
javax.annotation;bundle-version="1.2.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Import-Package: com.minres.scviewer.database,
|
||||
javax.inject;version="1.0.0"
|
||||
|
After Width: | Height: | Size: 770 B |
@ -22,6 +22,27 @@
|
||||
</property>
|
||||
</product>
|
||||
</extension>
|
||||
<extension
|
||||
id="product_slim"
|
||||
point="org.eclipse.core.runtime.products">
|
||||
<product
|
||||
application="org.eclipse.e4.ui.workbench.swt.E4Application"
|
||||
description="%product.description"
|
||||
name="SCViewer">
|
||||
<property
|
||||
name="lifeCycleURI"
|
||||
value="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.E4LifeCycle">
|
||||
</property>
|
||||
<property
|
||||
name="appName"
|
||||
value="SCViewer">
|
||||
</property>
|
||||
<property
|
||||
name="applicationCSS"
|
||||
value="platform:/plugin/com.minres.scviewer.e4.application/css/default.css">
|
||||
</property>
|
||||
</product>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.core.expressions.definitions">
|
||||
<definition
|
||||
|
@ -1,7 +1,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
||||
<version>2.6.1-SNAPSHOT</version>
|
||||
<version>2.8.1-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
|
@ -12,11 +12,14 @@ package com.minres.scviewer.e4.application;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.INodeChangeListener;
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
@ -64,9 +67,11 @@ public class E4LifeCycle {
|
||||
* @param eventBroker the event broker
|
||||
*/
|
||||
@PostContextCreate
|
||||
void postContextCreate(IApplicationContext appContext, final IEventBroker eventBroker) {
|
||||
void postContextCreate(IApplicationContext appContext, final IEventBroker eventBroker,
|
||||
final IEclipseContext workbenchContext) {
|
||||
|
||||
final String[] args = (String[])appContext.getArguments().get(IApplicationContext.APPLICATION_ARGS);
|
||||
Options opt = new Options(args, 0, 1);
|
||||
final Options opt = new Options(args, 0, Integer.MAX_VALUE);
|
||||
opt.getSet()
|
||||
.addOption("clearPersistedState", Multiplicity.ZERO_OR_ONE)
|
||||
.addOption("c", Separator.BLANK, Multiplicity.ZERO_OR_ONE);
|
||||
@ -77,22 +82,14 @@ public class E4LifeCycle {
|
||||
final String confFile =opt.getSet().isSet("c")?opt.getSet().getOption("c").getResultValue(0):"";
|
||||
|
||||
// react on the first view being created, at that time the UI is available
|
||||
eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE, new EventHandler() {
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
MPart part = (MPart) event.getProperty("ChangedElement"); //$NON-NLS-1$
|
||||
if(part!=null){
|
||||
IEclipseContext ctx = part.getContext();
|
||||
OpenViewHandler openViewHandler= new OpenViewHandler();
|
||||
if(confFile.length()>0) openViewHandler.setConfigFile(confFile);
|
||||
ContextInjectionFactory.inject(openViewHandler, ctx);
|
||||
eventBroker.unsubscribe(this);
|
||||
for(String name:opt.getSet().getData()){
|
||||
openViewHandler.openViewForFile(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// eventBroker.subscribe(UIEvents.UILifeCycle.ACTIVATE, new EventHandler() {
|
||||
// @Override
|
||||
// public void handleEvent(Event event) {
|
||||
// MPart part = (MPart) event.getProperty("ChangedElement"); //$NON-NLS-1$
|
||||
// if(part!=null){
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
eventBroker.subscribe(UIEvents.UILifeCycle.APP_STARTUP_COMPLETE, new EventHandler() {
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
@ -101,9 +98,20 @@ public class E4LifeCycle {
|
||||
boolean isLocked = instanceLocation.isLocked();
|
||||
if(isLocked)
|
||||
instanceLocation.release();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) { }
|
||||
if(opt.getSet().getData().size()>0) {
|
||||
MApplication app= workbenchContext.get(MApplication.class);
|
||||
EModelService modelService = workbenchContext.get(EModelService.class);
|
||||
EPartService partService= workbenchContext.get(EPartService.class);
|
||||
MPart part = partService .createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$
|
||||
part.setLabel(opt.getSet().getData().get(0));
|
||||
MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$
|
||||
partStack.getChildren().add(part);
|
||||
partService.showPart(part, PartState.CREATE);
|
||||
partService.showPart(part, PartState.ACTIVATE);
|
||||
IEclipseContext ctx = part.getContext();
|
||||
ctx.modify("input", opt.getSet().getData());
|
||||
ctx.modify("config", confFile); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -135,70 +143,4 @@ public class E4LifeCycle {
|
||||
@ProcessRemovals
|
||||
void processRemovals(IEclipseContext workbenchContext) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Join.
|
||||
*
|
||||
* @param tokens the tokens
|
||||
* @return the string
|
||||
*/
|
||||
String join(String[] tokens){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean first=true;
|
||||
for(String token:tokens){
|
||||
if(!first) sb.append(","); //$NON-NLS-1$
|
||||
sb.append(token);
|
||||
first=false;
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* The Class OpenViewHandler.
|
||||
*/
|
||||
private class OpenViewHandler {
|
||||
|
||||
/** The app. */
|
||||
@Inject MApplication app;
|
||||
|
||||
/** The model service. */
|
||||
@Inject EModelService modelService;
|
||||
|
||||
/** The part service. */
|
||||
@Inject EPartService partService;
|
||||
|
||||
String confFile="";
|
||||
/**
|
||||
* Open view for file.
|
||||
*
|
||||
* @param name the name
|
||||
*/
|
||||
public void openViewForFile(String name){
|
||||
File file = new File(getFirstFileName(name));
|
||||
if(!file.exists())
|
||||
return;
|
||||
MPart part = partService.createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$
|
||||
part.setLabel(file.getName());
|
||||
MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$
|
||||
partStack.getChildren().add(part);
|
||||
partService.showPart(part, PartState.ACTIVATE);
|
||||
IEclipseContext ctx=part.getContext();
|
||||
ctx.modify("input", name); //$NON-NLS-1$
|
||||
//ctx.declareModifiable("input"); //$NON-NLS-1$
|
||||
ctx.modify("config", confFile); //$NON-NLS-1$
|
||||
//ctx.declareModifiable("config"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private String getFirstFileName(String name) {
|
||||
if(name.contains(",")) {
|
||||
String[] tokens = name.split(",");
|
||||
return tokens[0];
|
||||
} else
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setConfigFile(String confFile) {
|
||||
this.confFile=confFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ public class Messages extends NLS {
|
||||
public static String TransactionDetails_21;
|
||||
public static String TransactionDetails_3;
|
||||
public static String TransactionDetails_4;
|
||||
public static String WaveformPreferencesPage_description;
|
||||
public static String WaveformPreferencesPage_1;
|
||||
public static String WaveformViewer_13;
|
||||
public static String WaveformViewer_14;
|
||||
@ -61,6 +62,30 @@ public class Messages extends NLS {
|
||||
public static String WaveStatusBarControl_6;
|
||||
public static String WaveStatusBarControl_7;
|
||||
public static String WaveStatusBarControl_8;
|
||||
public static String line;
|
||||
public static String line_highlite;
|
||||
public static String track_bg_even;
|
||||
public static String track_bg_odd;
|
||||
public static String track_bg_highlite;
|
||||
public static String tx_bg;
|
||||
public static String tx_bg_highlite;
|
||||
public static String tx_border;
|
||||
public static String signal0;
|
||||
public static String signal1;
|
||||
public static String signalz;
|
||||
public static String signalx;
|
||||
public static String signalu;
|
||||
public static String signal_text;
|
||||
public static String signal_real;
|
||||
public static String signal_nan;
|
||||
public static String cursor;
|
||||
public static String cursor_drag;
|
||||
public static String cursor_text;
|
||||
public static String marker;
|
||||
public static String marker_text;
|
||||
public static String rel_arrow;
|
||||
public static String rel_arrow_highlite;
|
||||
|
||||
static {
|
||||
// initialize resource bundle
|
||||
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
|
||||
|
@ -123,7 +123,7 @@ public class RelationTypeToolControl extends PartListener implements ISelectionC
|
||||
return;
|
||||
}
|
||||
}
|
||||
comboViewer.getCombo().setEnabled(false);
|
||||
if(comboViewer!=null) comboViewer.getCombo().setEnabled(false);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -1,7 +1,6 @@
|
||||
|
||||
package com.minres.scviewer.e4.application.elements;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -34,22 +33,46 @@ public class WaveformPopupMenuContribution {
|
||||
|
||||
final TrackEntry nullEntry = new TrackEntry(null);
|
||||
|
||||
private boolean selHasBitVector(ISelection sel, boolean checkForDouble) {
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
for(Object elem:(IStructuredSelection)sel) {
|
||||
if(elem instanceof TrackEntry) {
|
||||
TrackEntry e = (TrackEntry) elem;
|
||||
if(e.waveform instanceof ISignal<?>) {
|
||||
Object o = ((ISignal<?>) e.waveform).getEvents().firstEntry().getValue();
|
||||
if(checkForDouble && o instanceof Double)
|
||||
return true;
|
||||
else if(o instanceof BitVector && ((BitVector)o).getWidth()>1)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private TrackEntry getSingleTrackEntry(ISelection sel) {
|
||||
TrackEntry entry=null;
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
for(Object elem:(IStructuredSelection)sel) {
|
||||
if(elem instanceof TrackEntry) {
|
||||
if(entry != null)
|
||||
return null;
|
||||
entry = (TrackEntry) elem;
|
||||
}
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
@Evaluate
|
||||
public boolean evaluate() {
|
||||
Object obj = activePart.getObject();
|
||||
if(obj instanceof WaveformViewer){
|
||||
WaveformViewer wfv = (WaveformViewer)obj;
|
||||
ISelection sel = wfv.getSelection();
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
Object selected = ((IStructuredSelection)sel).getFirstElement();
|
||||
if(selected instanceof ISignal<?>) {
|
||||
Object x = ((ISignal<?>) selected).getEvents().firstEntry().getValue();
|
||||
if((x instanceof BitVector) && ((BitVector)x).getWidth()==1) {
|
||||
return false;
|
||||
} else
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return selHasBitVector(wfv.getSelection(), true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -60,39 +83,24 @@ public class WaveformPopupMenuContribution {
|
||||
if(obj instanceof WaveformViewer){
|
||||
WaveformViewer wfv = (WaveformViewer)obj;
|
||||
ISelection sel = wfv.getSelection();
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
||||
Object first = it.next();
|
||||
Object second=null;
|
||||
if(it.hasNext()) second=it.next();
|
||||
if(first instanceof ISignal<?>) {
|
||||
Object o = ((ISignal<?>) first).getEvents().firstEntry().getValue();
|
||||
//com.minres.scviewer.e4.application.menu.mulitvaluesettings
|
||||
if((o instanceof Double) || (o instanceof BitVector)) {
|
||||
TrackEntry entry=nullEntry;
|
||||
if(second instanceof TrackEntry)
|
||||
entry=(TrackEntry)second;
|
||||
if(o instanceof BitVector) {
|
||||
addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, entry.valueDisplay);
|
||||
addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, entry.valueDisplay);
|
||||
addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, entry.valueDisplay);
|
||||
TrackEntry elem = getSingleTrackEntry(sel);
|
||||
if(selHasBitVector(sel, false)) {
|
||||
addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, elem);
|
||||
addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, elem);
|
||||
addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, elem);
|
||||
items.add(MMenuFactory.INSTANCE.createMenuSeparator());
|
||||
addWaveMenuItem(items, application, modelService, "bit vector", TrackEntry.WaveDisplay.DEFAULT, entry.waveDisplay);
|
||||
addWaveMenuItem(items, application, modelService, "bit vector", TrackEntry.WaveDisplay.DEFAULT, elem);
|
||||
}
|
||||
addWaveMenuItem(items, application, modelService, "analog step-wise", TrackEntry.WaveDisplay.STEP_WISE, entry.waveDisplay);
|
||||
addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, entry.waveDisplay);
|
||||
addWaveMenuItem(items, application, modelService, "analog step-wise", TrackEntry.WaveDisplay.STEP_WISE, elem);
|
||||
addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, elem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addValueMenuItem(List<MMenuElement> items, MApplication application, EModelService modelService,
|
||||
String label, TrackEntry.ValueDisplay value, TrackEntry.ValueDisplay actual) {
|
||||
String label, TrackEntry.ValueDisplay value, TrackEntry elem) {
|
||||
MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
|
||||
item.setType(ItemType.RADIO);
|
||||
item.setSelected(value==actual);
|
||||
item.setSelected(elem != null && elem.valueDisplay == value);
|
||||
item.setLabel("Show as "+label);
|
||||
item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
|
||||
List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changevaluedisplay", MCommand.class, null);
|
||||
@ -106,10 +114,10 @@ public class WaveformPopupMenuContribution {
|
||||
}
|
||||
|
||||
private void addWaveMenuItem(List<MMenuElement> items, MApplication application, EModelService modelService,
|
||||
String label, TrackEntry.WaveDisplay value, TrackEntry.WaveDisplay actual) {
|
||||
String label, TrackEntry.WaveDisplay value, TrackEntry elem) {
|
||||
MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
|
||||
item.setType(ItemType.RADIO);
|
||||
item.setSelected(value==actual);
|
||||
item.setSelected(elem != null && elem.waveDisplay==value);
|
||||
item.setLabel("Render "+label);
|
||||
item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
|
||||
List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changewavedisplay", MCommand.class, null);
|
||||
|
@ -1,8 +1,6 @@
|
||||
|
||||
package com.minres.scviewer.e4.application.handlers;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
@ -34,18 +32,14 @@ public class ChangeValueDisplay {
|
||||
WaveformViewer wfv = (WaveformViewer)obj;
|
||||
ISelection sel = wfv.getSelection();
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
||||
it.next();
|
||||
if(it.hasNext()) {
|
||||
Object second = it.next();
|
||||
if(second instanceof TrackEntry) {
|
||||
for(Object elem:(IStructuredSelection)sel) {
|
||||
if(elem instanceof TrackEntry) {
|
||||
TrackEntry.ValueDisplay val= TrackEntry.ValueDisplay.valueOf(param);
|
||||
((TrackEntry)second).valueDisplay=val;
|
||||
((TrackEntry)elem).valueDisplay=val;
|
||||
}
|
||||
}
|
||||
wfv.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,8 +1,6 @@
|
||||
|
||||
package com.minres.scviewer.e4.application.handlers;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
@ -34,18 +32,15 @@ public class ChangeWaveformDisplay {
|
||||
WaveformViewer wfv = (WaveformViewer)obj;
|
||||
ISelection sel = wfv.getSelection();
|
||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
||||
it.next();
|
||||
if(it.hasNext()) {
|
||||
Object second = it.next();
|
||||
if(second instanceof TrackEntry) {
|
||||
for(Object elem:(IStructuredSelection)sel) {
|
||||
if(elem instanceof TrackEntry) {
|
||||
TrackEntry.WaveDisplay val= TrackEntry.WaveDisplay.valueOf(param);
|
||||
((TrackEntry)second).waveDisplay=val;
|
||||
((TrackEntry)elem).waveDisplay=val;
|
||||
}
|
||||
}
|
||||
wfv.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -17,23 +17,30 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||
|
||||
public class DeleteWaveformHandler {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@CanExecute
|
||||
public Boolean canExecute(ESelectionService selectionService){
|
||||
Object o = selectionService.getSelection();
|
||||
return o instanceof IStructuredSelection && ((IStructuredSelection)o).getFirstElement() instanceof IWaveform;
|
||||
if(o instanceof IStructuredSelection) {
|
||||
IStructuredSelection sel = (IStructuredSelection) o;
|
||||
if(sel.size()>0)
|
||||
return sel.toList().stream().allMatch(e-> e instanceof TrackEntry);
|
||||
else
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(ESelectionService selectionService, MPart activePart) {
|
||||
Object o = activePart.getObject();
|
||||
Object sel = selectionService.getSelection();
|
||||
if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform){
|
||||
((WaveformViewer)o).removeStreamFromList((IWaveform) ((IStructuredSelection)sel).getFirstElement());
|
||||
if(o instanceof WaveformViewer){
|
||||
((WaveformViewer)o).removeSelectedStreamsFromList();
|
||||
}
|
||||
}
|
||||
}
|
@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
|
||||
import com.minres.scviewer.database.ITx;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||
|
||||
public class MoveWaveformHandler {
|
||||
@ -33,7 +34,7 @@ public class MoveWaveformHandler {
|
||||
Object sel = selectionService.getSelection();
|
||||
if( sel instanceof IStructuredSelection) {
|
||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||
return o instanceof IWaveform || o instanceof ITx;
|
||||
return o instanceof IWaveform || o instanceof ITx | o instanceof TrackEntry;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import com.minres.scviewer.database.ITx;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||
|
||||
public class NavigateEvent {
|
||||
@ -34,7 +35,7 @@ public class NavigateEvent {
|
||||
Object sel = selectionService.getSelection();
|
||||
if( sel instanceof IStructuredSelection) {
|
||||
Object o= ((IStructuredSelection)sel).getFirstElement();
|
||||
return o instanceof IWaveform || o instanceof ITx;
|
||||
return o instanceof IWaveform || o instanceof ITx || o instanceof TrackEntry;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
package com.minres.scviewer.e4.application.handlers;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
@ -39,13 +40,14 @@ public class OpenHandler {
|
||||
part.setLabel(files.get(0).getName());
|
||||
MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$
|
||||
partStack.getChildren().add(part);
|
||||
partService.showPart(part, PartState.ACTIVATE);
|
||||
partService.showPart(part, PartState.CREATE);
|
||||
final IEclipseContext ctx=part.getContext();
|
||||
files.stream()
|
||||
.map(x -> x.getAbsolutePath())
|
||||
.reduce((s1, s2) -> s1 + "," + s2)
|
||||
.ifPresent(s -> ctx.modify("input", s)); //$NON-NLS-1$
|
||||
List<String> inputs=new ArrayList<>();
|
||||
for(File f: files)
|
||||
inputs.add(f.getAbsolutePath());
|
||||
ctx.modify("input", inputs);
|
||||
ctx.modify("config", ""); //$NON-NLS-1$
|
||||
partStack.setSelectedElement(part);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2015 MINRES Technologies GmbH and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* MINRES Technologies GmbH - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.e4.application.handlers;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.ui.model.application.MApplication;
|
||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||
public class ReloadHandler {
|
||||
|
||||
@CanExecute
|
||||
public boolean canExecute(EPartService partService) {
|
||||
MPart part = partService.getActivePart();
|
||||
if(part==null) return false;
|
||||
return (part.getObject() instanceof WaveformViewer);
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(Shell shell, MApplication app, EModelService modelService,
|
||||
EPartService partService){
|
||||
|
||||
MPart part = partService.getActivePart();
|
||||
Object obj = part.getObject();
|
||||
if(part!=null && (obj instanceof WaveformViewer)) {
|
||||
((WaveformViewer)obj).reloadDatabase();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -35,6 +35,7 @@ TransactionDetails_20=Time
|
||||
TransactionDetails_21=End time
|
||||
TransactionDetails_3=Value
|
||||
TransactionDetails_4=Relation
|
||||
WaveformPreferencesPage_description=Default Waveform Window Settings
|
||||
WaveformPreferencesPage_1=Color for
|
||||
WaveformViewer_13=Database Load Status
|
||||
WaveformViewer_14=Database Load Cancelled
|
||||
@ -55,3 +56,27 @@ WaveStatusBarControl_5=C:
|
||||
WaveStatusBarControl_6=M:
|
||||
WaveStatusBarControl_7=C-M:
|
||||
WaveStatusBarControl_8=Z:
|
||||
line=Track line
|
||||
line_highlite=higlighted Track line
|
||||
track_bg_even=even Track Background
|
||||
track_bg_odd=odd Track Background
|
||||
track_bg_highlite=highlighted Track Background
|
||||
tx_bg=Transaction Background
|
||||
tx_bg_highlite=highlighted Transaction Background
|
||||
tx_border=Transaction Border
|
||||
signal0=Signal Value '0'
|
||||
signal1=Signal Value '1'
|
||||
signalz=Signal Value 'Z'
|
||||
signalx=Signal Value 'X'
|
||||
signalu=Signal Value 'U'
|
||||
signal_text=Signal text
|
||||
signal_real=Signal real Value
|
||||
signal_nan=Signal NaN Value
|
||||
cursor=Cursor
|
||||
cursor_drag=dragged Cursor
|
||||
cursor_text=Cursor Text
|
||||
marker=Marker
|
||||
marker_text=Marker TExt
|
||||
rel_arrow=Relation arrow
|
||||
rel_arrow_highlite=highlighted Relation arrorw
|
||||
|
||||
|
@ -64,6 +64,7 @@ import org.eclipse.swt.events.PaintEvent;
|
||||
import org.eclipse.swt.events.PaintListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
@ -149,6 +150,14 @@ public class DesignBrowser {
|
||||
treeViewer.refresh();
|
||||
}
|
||||
});
|
||||
} else if("WAVEFORMS".equals(evt.getPropertyName())) {
|
||||
treeViewer.getTree().getDisplay().asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
IWaveformDb database = waveformViewerPart.getDatabase();
|
||||
treeViewer.setInput(Arrays.asList(database.isLoaded()?new IWaveformDb[]{database}:new IWaveformDb[]{new LoadingWaveformDb()}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -177,7 +186,8 @@ public class DesignBrowser {
|
||||
* @param parent the parent
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createComposite(Composite parent) {
|
||||
public void createComposite(Composite parent, @Optional WaveformViewer waveformViewerPart) {
|
||||
parent.setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
sashForm = new SashForm(parent, SWT.BORDER | SWT.SMOOTH | SWT.VERTICAL);
|
||||
|
||||
top = new Composite(sashForm, SWT.NONE);
|
||||
@ -193,6 +203,8 @@ public class DesignBrowser {
|
||||
top.removeControlListener(this);
|
||||
}
|
||||
});
|
||||
if(waveformViewerPart!=null)
|
||||
setWaveformViewer(waveformViewerPart);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -366,13 +378,11 @@ public class DesignBrowser {
|
||||
* @param waveformViewerPart the waveform viewer part
|
||||
* @return the status event
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Inject @Optional
|
||||
public void getActiveWaveformViewerEvent(@UIEventTopic(WaveformViewer.ACTIVE_WAVEFORMVIEW) WaveformViewer waveformViewerPart) {
|
||||
if(this.waveformViewerPart!=null) {
|
||||
this.waveformViewerPart.storeDesignBrowerState(new DBState());
|
||||
}
|
||||
if( this.waveformViewerPart == null || this.waveformViewerPart != waveformViewerPart ) {
|
||||
if(this.waveformViewerPart!=null)
|
||||
this.waveformViewerPart.storeDesignBrowerState(new DBState());
|
||||
waveformViewerPart.addDisposeListener( new DisposeListener() {
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
@ -384,7 +394,12 @@ public class DesignBrowser {
|
||||
}
|
||||
}
|
||||
} );
|
||||
setWaveformViewer(waveformViewerPart);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setWaveformViewer(WaveformViewer waveformViewerPart) {
|
||||
this.waveformViewerPart=waveformViewerPart;
|
||||
IWaveformDb database = waveformViewerPart.getDatabase();
|
||||
Object input = treeViewer.getInput();
|
||||
|
@ -381,16 +381,12 @@ public class FileBrowserDialog extends TrayDialog {
|
||||
class FileTreeLabelProvider implements ILabelProvider {
|
||||
private List<ILabelProviderListener> listeners;
|
||||
|
||||
private Image file;
|
||||
|
||||
private Image dir;
|
||||
|
||||
public FileTreeLabelProvider() {
|
||||
listeners = new ArrayList<ILabelProviderListener>();
|
||||
}
|
||||
|
||||
public Image getImage(Object arg0) {
|
||||
return ((File) arg0).isDirectory() ? folderImage : file;
|
||||
return ((File) arg0).isDirectory() ? folderImage : fileImage;
|
||||
}
|
||||
|
||||
public String getText(Object arg0) {
|
||||
@ -402,16 +398,12 @@ public class FileBrowserDialog extends TrayDialog {
|
||||
listeners.add(arg0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
// Dispose the images
|
||||
if (dir != null)
|
||||
dir.dispose();
|
||||
if (file != null)
|
||||
file.dispose();
|
||||
}
|
||||
|
||||
public boolean isLabelProperty(Object arg0, String arg1) {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void removeListener(ILabelProviderListener arg0) {
|
||||
|
@ -120,7 +120,9 @@ public class TransactionDetails {
|
||||
* @param parent the parent
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createComposite(final Composite parent) {
|
||||
public void createComposite(final Composite parent, @Optional WaveformViewer waveformViewerPart) {
|
||||
this.waveformViewerPart=waveformViewerPart;
|
||||
|
||||
parent.setLayout(new GridLayout(1, false));
|
||||
|
||||
nameFilter = new Text(parent, SWT.BORDER);
|
||||
@ -262,6 +264,7 @@ public class TransactionDetails {
|
||||
*/
|
||||
@Focus
|
||||
public void setFocus() {
|
||||
if(treeViewer!=null)
|
||||
treeViewer.getTree().setFocus();
|
||||
}
|
||||
|
||||
@ -392,7 +395,7 @@ public class TransactionDetails {
|
||||
if( part == null || ! (part.getObject() instanceof WaveformViewer ) )
|
||||
return;
|
||||
if(treeViewer!=null && selection!=null && !treeViewer.getTree().isDisposed()){
|
||||
if( selection instanceof IStructuredSelection) {
|
||||
if( selection instanceof IStructuredSelection && !selection.isEmpty()) {
|
||||
setInput(((IStructuredSelection)selection).getFirstElement());
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ import org.eclipse.core.runtime.preferences.DefaultScope;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.di.extensions.Preference;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
@ -60,6 +62,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.SashForm;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.events.FocusListener;
|
||||
@ -69,6 +72,7 @@ import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.layout.FillLayout;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
@ -90,17 +94,17 @@ import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.IWaveformDb;
|
||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
||||
import com.minres.scviewer.database.RelationType;
|
||||
import com.minres.scviewer.database.swt.Constants;
|
||||
import com.minres.scviewer.database.swt.ToolTipContentProvider;
|
||||
import com.minres.scviewer.database.swt.ToolTipHelpTextProvider;
|
||||
import com.minres.scviewer.database.swt.WaveformViewerFactory;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.ICursor;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
||||
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
import com.minres.scviewer.database.ui.swt.Constants;
|
||||
import com.minres.scviewer.database.ui.swt.ToolTipContentProvider;
|
||||
import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider;
|
||||
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
||||
import com.minres.scviewer.e4.application.Messages;
|
||||
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
||||
import com.minres.scviewer.e4.application.internal.util.FileMonitor;
|
||||
@ -164,10 +168,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
private static int disposeListenerNumber = 0;
|
||||
|
||||
/** The factory. */
|
||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
||||
WaveformViewFactory factory = new WaveformViewFactory();
|
||||
|
||||
DesignBrowser browser = null;
|
||||
|
||||
TransactionDetails detailsView = null;
|
||||
|
||||
/** The waveform pane. */
|
||||
private IWaveformViewer waveformPane;
|
||||
private IWaveformView waveformPane;
|
||||
|
||||
/** get UISynchronize injected as field */
|
||||
@Inject UISynchronize sync;
|
||||
@ -199,7 +207,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
private boolean checkForUpdates;
|
||||
|
||||
/** The my part. */
|
||||
private MPart myPart;
|
||||
@Inject private MPart myPart;
|
||||
|
||||
/** The my parent. */
|
||||
private Composite myParent;
|
||||
@ -207,6 +215,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
/** The files to load. */
|
||||
ArrayList<File> filesToLoad = new ArrayList<>();
|
||||
|
||||
String partConfig = "";
|
||||
|
||||
/** The persisted state. */
|
||||
Map<String, String> persistedState;
|
||||
|
||||
@ -217,7 +227,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
private Object detailsSettings;
|
||||
|
||||
/** The navigation relation type. */
|
||||
private RelationType navigationRelationType=IWaveformViewer.NEXT_PREV_IN_STREAM ;
|
||||
private RelationType navigationRelationType=IWaveformView.NEXT_PREV_IN_STREAM ;
|
||||
|
||||
/** The file monitor. */
|
||||
FileMonitor fileMonitor = new FileMonitor();
|
||||
@ -225,6 +235,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
/** The file checker. */
|
||||
IModificationChecker fileChecker;
|
||||
|
||||
@Inject IWaveformDbFactory dbFactory;
|
||||
|
||||
@Inject Composite parent;
|
||||
|
||||
private Boolean showHover;
|
||||
|
||||
/**
|
||||
@ -235,7 +249,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @param dbFactory the db factory
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory, @Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs, @Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
public void createComposite(MPart part, EMenuService menuService, @Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs, @Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
disposeListenerNumber += 1;
|
||||
|
||||
myPart = part;
|
||||
@ -256,13 +270,38 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
}
|
||||
}
|
||||
});
|
||||
waveformPane = factory.createPanel(parent);
|
||||
parent.setLayout(new FillLayout(SWT.HORIZONTAL));
|
||||
SashForm sashFormTop = new SashForm(parent, SWT.BORDER | SWT.SMOOTH);
|
||||
|
||||
Composite left = new Composite(sashFormTop, SWT.NONE);
|
||||
|
||||
IEclipseContext ctx = myPart.getContext();
|
||||
ctx.set(WaveformViewer.class, this);
|
||||
ctx.set(IWaveformDb.class, database);
|
||||
ctx.set(Composite.class, left);
|
||||
|
||||
browser = ContextInjectionFactory.make(DesignBrowser.class, ctx);
|
||||
|
||||
//Composite right = new Composite(sashFormTop, SWT.NONE);
|
||||
SashForm sashFormRight = new SashForm(sashFormTop, SWT.BORDER | SWT.SMOOTH | SWT.VERTICAL);
|
||||
sashFormTop.setWeights(new int[] {25, 75});
|
||||
|
||||
Composite rightTop = new Composite(sashFormRight, SWT.NONE);
|
||||
Composite rightBottom = new Composite(sashFormRight, SWT.NONE);
|
||||
sashFormRight.setWeights(new int[] {80, 20});
|
||||
|
||||
waveformPane = factory.createPanel(rightTop);
|
||||
|
||||
ctx.set(Composite.class, rightBottom);
|
||||
detailsView = ContextInjectionFactory.make(TransactionDetails.class, ctx);
|
||||
|
||||
|
||||
waveformPane.setMaxTime(0);
|
||||
setupColors();
|
||||
//set selection to empty selection when opening a new waveformPane
|
||||
selectionService.setSelection(new StructuredSelection());
|
||||
|
||||
waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
waveformPane.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
@ -272,7 +311,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
|
||||
}
|
||||
});
|
||||
waveformPane.addPropertyChangeListener(IWaveformViewer.MARKER_PROPERTY, new PropertyChangeListener() {
|
||||
waveformPane.addPropertyChangeListener(IWaveformView.MARKER_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
@ -478,13 +517,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnShowHoverChange(@Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
public void reactOnShowHoverChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE, value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
showHover=hover;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnReloadDatabaseChange(@Preference(value = PreferenceConstants.DATABASE_RELOAD) Boolean checkForUpdates) {
|
||||
public void reactOnReloadDatabaseChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE, value = PreferenceConstants.DATABASE_RELOAD) Boolean checkForUpdates) {
|
||||
if (checkForUpdates) {
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad, FILE_CHECK_INTERVAL);
|
||||
} else {
|
||||
@ -538,6 +577,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @param state the state
|
||||
*/
|
||||
protected void loadDatabase(final Map<String, String> state) {
|
||||
loadDatabase(state, 1000L);
|
||||
}
|
||||
|
||||
protected void loadDatabase(final Map<String, String> state, long delay) {
|
||||
fileMonitor.removeFileChangeListener(this);
|
||||
Job job = new Job(Messages.WaveformViewer_15) {
|
||||
@Override
|
||||
@ -580,8 +623,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
return result;
|
||||
}
|
||||
};
|
||||
job.setName("Load Database");
|
||||
job.setSystem(true);
|
||||
job.schedule(1000L); // let the UI initialize so that we have a progress monitor
|
||||
job.schedule(delay); // let the UI initialize so that we have a progress monitor
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -595,16 +639,21 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
public void run() {
|
||||
if (MessageDialog.openQuestion(display.getActiveShell(), Messages.WaveformViewer_17,
|
||||
Messages.WaveformViewer_18)) {
|
||||
reloadDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
fileMonitor.removeFileChangeListener(this);
|
||||
}
|
||||
|
||||
public void reloadDatabase() {
|
||||
Map<String, String> state = new HashMap<>();
|
||||
saveWaveformViewerState(state);
|
||||
waveformPane.getStreamList().clear();
|
||||
database.clear();
|
||||
if (filesToLoad.size() > 0)
|
||||
loadDatabase(state);
|
||||
}
|
||||
}
|
||||
});
|
||||
fileMonitor.removeFileChangeListener(this);
|
||||
loadDatabase(state, 0L);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -614,48 +663,21 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*/
|
||||
@Inject
|
||||
@Optional
|
||||
public void setPartInput(@Named("input") Object partInput, @Named("config") Object partConfig) {
|
||||
if (partInput instanceof String) {
|
||||
String name = (String)partInput;
|
||||
filesToLoad = new ArrayList<File>();
|
||||
boolean explicit = name.contains(",");
|
||||
for(String tok: name.split(",")) {
|
||||
File file = new File(tok);
|
||||
if(file.isFile() && "CURRENT".equals(file.getName())){
|
||||
public void setPartInput(@Named("input") List<String> partInput, @Named("config") String partConfig) {
|
||||
for(String s:partInput) {
|
||||
File file = new File(s);
|
||||
if(file.isFile() && "CURRENT".equals(file.getName()))
|
||||
file=file.getParentFile();
|
||||
}
|
||||
if (file.exists()) {
|
||||
if (file.exists())
|
||||
filesToLoad.add(file);
|
||||
}
|
||||
if(!explicit)
|
||||
try {
|
||||
String ext = getFileExtension(file.getName());
|
||||
if (Messages.WaveformViewer_19.equals(ext.toLowerCase())) {
|
||||
if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20)))) {
|
||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_20)));
|
||||
} else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)))) {
|
||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_21)));
|
||||
} else if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_22)))) {
|
||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_22)));
|
||||
}
|
||||
} else if (Messages.WaveformViewer_20.equals(ext.toLowerCase()) ||
|
||||
Messages.WaveformViewer_21.equals(ext.toLowerCase()) ||
|
||||
Messages.WaveformViewer_22.equals(ext.toLowerCase())
|
||||
) {
|
||||
if (askIfToLoad(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)))) {
|
||||
filesToLoad.add(new File(renameFileExtension(file.getCanonicalPath(), Messages.WaveformViewer_19)));
|
||||
}
|
||||
}
|
||||
} catch (IOException e) { // silently ignore any error
|
||||
}
|
||||
|
||||
if(partConfig!=null) {
|
||||
this.partConfig=partConfig;
|
||||
}
|
||||
if (filesToLoad.size() > 0)
|
||||
loadDatabase(persistedState);
|
||||
if(partConfig instanceof String && ((String)partConfig).length()>0) {
|
||||
loadState((String) partConfig);
|
||||
}
|
||||
}
|
||||
if(partConfig.length()>0)
|
||||
loadState(partConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -663,7 +685,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*/
|
||||
@Focus
|
||||
public void setFocus() {
|
||||
waveformPane.getWaveformControl().setFocus();
|
||||
if(waveformPane!=null) waveformPane.getWaveformControl().setFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -756,10 +778,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
// get selected transaction of a stream
|
||||
ISelection selection = waveformPane.getSelection();
|
||||
if (!selection.isEmpty()) {
|
||||
List<Object> t = getISelection(selection);
|
||||
if(t.get(0) instanceof ITx) {
|
||||
ITx tx = (ITx) t.get(0);
|
||||
TrackEntry te = (TrackEntry) t.get(1);
|
||||
List<Object> sel = getISelection(selection);
|
||||
if(sel.size()>1 && sel.get(0) instanceof ITx && sel.get(1) instanceof TrackEntry) {
|
||||
ITx tx = (ITx) sel.get(0);
|
||||
TrackEntry te = (TrackEntry) sel.get(1);
|
||||
// get transaction id
|
||||
persistedState.put(SELECTED_TX_ID, Long.toString(tx.getId()));
|
||||
//get TrackEntry name
|
||||
@ -992,6 +1014,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
waveformPane.getStreamList().addAll(streams);
|
||||
} else {
|
||||
Object first = selection.getFirstElement();
|
||||
if(first instanceof ITx) {
|
||||
IWaveform stream = (first instanceof ITx) ? ((ITx) first).getStream() : (IWaveform) first;
|
||||
TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
|
||||
if (insert) {
|
||||
@ -1000,60 +1023,27 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
} else {
|
||||
waveformPane.getStreamList().addAll(streams);
|
||||
}
|
||||
} else if(first instanceof TrackEntry) {
|
||||
TrackEntry trackEntry = (TrackEntry) first;
|
||||
if (insert) {
|
||||
int index = waveformPane.getStreamList().indexOf(trackEntry);
|
||||
waveformPane.getStreamList().addAll(index, streams);
|
||||
} else {
|
||||
waveformPane.getStreamList().addAll(streams);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
setFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the stream from list.
|
||||
*
|
||||
* @param stream the stream
|
||||
*/
|
||||
public void removeStreamFromList(IWaveform stream) {
|
||||
TrackEntry trackEntry = waveformPane.getEntryForStream(stream);
|
||||
List<TrackEntry> streams = waveformPane.getStreamList();
|
||||
ISelection sel = waveformPane.getSelection();
|
||||
TrackEntry newSelection=null;
|
||||
|
||||
if(sel instanceof IStructuredSelection && ((IStructuredSelection) sel).size()==2) {
|
||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
||||
it.next();
|
||||
int idx = streams.indexOf(it.next());
|
||||
|
||||
if(idx==streams.size()-1) {
|
||||
//last stream gets deleted, no more selection
|
||||
if(idx==0) {
|
||||
newSelection=null;
|
||||
}
|
||||
//more than 1 stream left, last gets deleted, selection jumps to new last stream
|
||||
else {
|
||||
newSelection=streams.get(idx-1);
|
||||
}
|
||||
}
|
||||
//more than 1 stream left, any stream but the last gets deleted, selection jumps to the next stream
|
||||
else {
|
||||
newSelection=streams.get(idx+1);
|
||||
}
|
||||
}
|
||||
waveformPane.setSelection(new StructuredSelection());
|
||||
streams.remove(trackEntry);
|
||||
if(newSelection!=null) {
|
||||
Object[] o = {newSelection};
|
||||
waveformPane.setSelection(new StructuredSelection(o));
|
||||
}
|
||||
public void removeSelectedStreamsFromList() {
|
||||
waveformPane.deleteSelectedTracks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the streams from list.
|
||||
*
|
||||
* @param iWaveforms the i waveforms
|
||||
*/
|
||||
public void removeStreamsFromList(IWaveform[] iWaveforms) {
|
||||
for (IWaveform stream : iWaveforms)
|
||||
removeStreamFromList(stream);
|
||||
public void removeStreamFromList(ISelection sel) {
|
||||
waveformPane.deleteSelectedTracks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Move selected.
|
||||
*
|
||||
@ -1150,7 +1140,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @return the selection
|
||||
*/
|
||||
public ISelection getSelection() {
|
||||
if(waveformPane!=null)
|
||||
return waveformPane.getSelection();
|
||||
else
|
||||
return new StructuredSelection();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1215,7 +1208,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*/
|
||||
public List<RelationType> getAllRelationTypes() {
|
||||
List<RelationType> res =new ArrayList<>();
|
||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
res.add(IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
res.addAll(database.getAllRelationTypes());
|
||||
return res;
|
||||
}
|
||||
@ -1227,7 +1220,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*/
|
||||
public List<RelationType> getSelectionRelationTypes() {
|
||||
List<RelationType> res =new ArrayList<>();
|
||||
res.add(IWaveformViewer.NEXT_PREV_IN_STREAM);
|
||||
res.add(IWaveformView.NEXT_PREV_IN_STREAM);
|
||||
ISelection selection = waveformPane.getSelection();
|
||||
if(selection instanceof IStructuredSelection && !selection.isEmpty()){
|
||||
IStructuredSelection sel=(IStructuredSelection) selection;
|
||||
@ -1301,5 +1294,4 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -10,6 +10,9 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.e4.application.preferences;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.eclipse.jface.preference.ColorFieldEditor;
|
||||
import org.eclipse.jface.preference.FieldEditorPreferencePage;
|
||||
|
||||
@ -26,6 +29,7 @@ public class WaveformPreferencesPage extends FieldEditorPreferencePage {
|
||||
*/
|
||||
public WaveformPreferencesPage() {
|
||||
super(GRID);
|
||||
setDescription(Messages.WaveformPreferencesPage_description);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -33,9 +37,18 @@ public class WaveformPreferencesPage extends FieldEditorPreferencePage {
|
||||
*/
|
||||
@Override
|
||||
protected void createFieldEditors() {
|
||||
|
||||
Field[] declaredFields = Messages.class.getDeclaredFields();
|
||||
HashMap<String, String> staticFields = new HashMap<String, String>();
|
||||
for (Field field : declaredFields) {
|
||||
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||
try {
|
||||
staticFields.put(field.getName(), (String)field.get(null));
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {}
|
||||
}
|
||||
}
|
||||
for (WaveformColors c : WaveformColors.values()) {
|
||||
addField(new ColorFieldEditor(c.name() + "_COLOR", Messages.WaveformPreferencesPage_1 + c.name().toLowerCase(), //$NON-NLS-1$
|
||||
addField(new ColorFieldEditor(c.name() + "_COLOR",
|
||||
Messages.WaveformPreferencesPage_1 + staticFields.get(c.name().toLowerCase()), //$NON-NLS-1$
|
||||
getFieldEditorParent()));
|
||||
}
|
||||
}
|
||||
|
@ -29,24 +29,24 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
|
||||
/** The show nodes. */
|
||||
// private List<HierNode> nodes;
|
||||
private boolean showNodes;
|
||||
private boolean tabelEntries;
|
||||
|
||||
/**
|
||||
* Instantiates a new tx db content provider.
|
||||
*/
|
||||
public TxDbContentProvider() {
|
||||
super();
|
||||
this.showNodes = false;
|
||||
this.tabelEntries = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new tx db content provider.
|
||||
*
|
||||
* @param showNodes the show nodes
|
||||
* @param tableEntries get nodes for waveform table entries
|
||||
*/
|
||||
public TxDbContentProvider(boolean showNodes) {
|
||||
public TxDbContentProvider(boolean tableEntries) {
|
||||
super();
|
||||
this.showNodes = showNodes;
|
||||
this.tabelEntries = tableEntries;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -60,7 +60,6 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
*/
|
||||
@Override
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// showNodes=!(newInput instanceof IHierNode);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -68,11 +67,13 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
if(inputElement instanceof IHierNode){
|
||||
if(tabelEntries && inputElement instanceof IWaveformDb){
|
||||
return new Object[]{};
|
||||
}else if(inputElement instanceof IHierNode){
|
||||
Collection<IHierNode> res = Collections2.filter(((IHierNode)inputElement).getChildNodes(), new Predicate<IHierNode>(){
|
||||
@Override
|
||||
public boolean apply(IHierNode arg0) {
|
||||
if(showNodes){
|
||||
if(tabelEntries){
|
||||
return arg0 instanceof IWaveform;
|
||||
} else{
|
||||
return arg0.getChildNodes().size()!=0;
|
||||
@ -82,8 +83,6 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||
return res.toArray();
|
||||
}else if(inputElement instanceof List<?>){
|
||||
return ((List<?>)inputElement).toArray();
|
||||
}else if(inputElement instanceof IWaveformDb){
|
||||
return new Object[]{};
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
@ -63,12 +63,6 @@ public class TxDbLabelProvider implements ILabelProvider {
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
if(loadinDatabase!=null) database.dispose();
|
||||
if(database!=null) database.dispose();
|
||||
if(stream!=null) stream.dispose();
|
||||
if(folder!=null) folder.dispose();
|
||||
if(signal!=null) signal.dispose();
|
||||
if(wave!=null) wave.dispose();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -9,4 +9,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
@ -6,7 +6,6 @@ Bundle-Version: 1.0.1.qualifier
|
||||
Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin
|
||||
Bundle-Vendor: MINRES Technologies GmbH
|
||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
||||
com.minres.scviewer.database.ui;bundle-version="1.0.0",
|
||||
com.minres.scviewer.database.ui.swt;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources,
|
||||
|
@ -48,15 +48,15 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
|
||||
import com.minres.scviewer.database.IWaveform;
|
||||
import com.minres.scviewer.database.IWaveformDb;
|
||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
||||
import com.minres.scviewer.database.swt.WaveformViewerFactory;
|
||||
import com.minres.scviewer.database.ui.GotoDirection;
|
||||
import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.IWaveformView;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
||||
import com.minres.scviewer.ui.views.TxOutlinePage;
|
||||
|
||||
public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor {
|
||||
|
||||
private IWaveformDbFactory waveformDbFactory;
|
||||
private static IWaveformDbFactory waveformDbFactory;
|
||||
|
||||
public synchronized void bind(IWaveformDbFactory factory){
|
||||
waveformDbFactory=factory;
|
||||
@ -78,7 +78,7 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
|
||||
public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave";
|
||||
|
||||
private IWaveformViewer txDisplay;
|
||||
private IWaveformView txDisplay;
|
||||
|
||||
/** This is the root of the editor's model. */
|
||||
private IWaveformDb database;
|
||||
@ -112,10 +112,10 @@ public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPage
|
||||
}
|
||||
}
|
||||
});
|
||||
WaveformViewerFactory factory = new WaveformViewerFactory();
|
||||
WaveformViewFactory factory = new WaveformViewFactory();
|
||||
txDisplay = factory.createPanel(parent);
|
||||
txDisplay.setMaxTime(0);
|
||||
txDisplay.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
txDisplay.addPropertyChangeListener(IWaveformView.CURSOR_PROPERTY, new PropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
Long time = (Long) evt.getNewValue();
|
||||
|
4
pom.xml
@ -13,7 +13,6 @@
|
||||
<module>plugins/com.minres.scviewer.database.text</module>
|
||||
<module>plugins/com.minres.scviewer.database.vcd</module>
|
||||
<module>tests/com.minres.scviewer.database.test</module>
|
||||
<module>plugins/com.minres.scviewer.database.ui</module>
|
||||
<module>plugins/com.minres.scviewer.database.ui.swt</module>
|
||||
<module>plugins/com.minres.scviewer.e4.application</module>
|
||||
<module>plugins/com.minres.scviewer.ui</module>
|
||||
@ -23,7 +22,8 @@
|
||||
<module>features/com.minres.scviewer.e4.platform.feature</module>
|
||||
<module>features/com.minres.scviewer.e4.feature</module>
|
||||
<module>p2repositories//com.minres.scviewer.updateSite</module>
|
||||
<module>com.minres.scviewer.e4.product</module>
|
||||
<module>products/com.minres.scviewer.e4.product</module>
|
||||
<module>products/com.minres.scviewer.e4.product_slim</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
Before Width: | Height: | Size: 290 KiB After Width: | Height: | Size: 290 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 256 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
@ -7,10 +7,10 @@
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.6.1-SNAPSHOT</version>
|
||||
<version>2.8.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
@ -45,7 +45,7 @@
|
||||
</formats>
|
||||
<products>
|
||||
<product>
|
||||
<id>scviewer</id>
|
||||
<id>product</id>
|
||||
<archiveFileName>SCViewer-${project.version}</archiveFileName>
|
||||
<rootFolders>
|
||||
<macosx>SCViewer.app</macosx>
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?pde version="3.5"?>
|
||||
|
||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.6.1.qualifier" useFeatures="true" includeLaunchers="true">
|
||||
<product name="SCViewer" uid="product" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.8.1.qualifier" useFeatures="true" includeLaunchers="true">
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
<windowImages/>
|
||||
|
||||
|
||||
<launcher name="scviewer">
|
||||
<linux icon="icons/SCViewer_512x512.xpm"/>
|
||||
<macosx icon="icons/SCViewer.icns"/>
|
@ -1,2 +1 @@
|
||||
/bin/
|
||||
/target/
|
11
products/com.minres.scviewer.e4.product_slim/.project
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.minres.scviewer.e4.product_slim</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
</natures>
|
||||
</projectDescription>
|
BIN
products/com.minres.scviewer.e4.product_slim/icons/SCViewer.icns
Normal file
BIN
products/com.minres.scviewer.e4.product_slim/icons/SCViewer.ico
Normal file
After Width: | Height: | Size: 290 KiB |
BIN
products/com.minres.scviewer.e4.product_slim/icons/SCViewer.png
Normal file
After Width: | Height: | Size: 103 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 256 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 2.5 KiB |