Merge branch 'release/2.7.0'
This commit is contained in:
commit
3de6c9900c
|
@ -10,7 +10,7 @@
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||||
<version>2.6.1-SNAPSHOT</version>
|
<version>2.7.0-SNAPSHOT</version>
|
||||||
<packaging>eclipse-repository</packaging>
|
<packaging>eclipse-repository</packaging>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<?pde version="3.5"?>
|
<?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="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.7.0.qualifier" useFeatures="true" includeLaunchers="true">
|
||||||
|
|
||||||
<configIni use="default">
|
<configIni use="default">
|
||||||
</configIni>
|
</configIni>
|
||||||
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
<windowImages/>
|
<windowImages/>
|
||||||
|
|
||||||
|
|
||||||
<launcher name="scviewer">
|
<launcher name="scviewer">
|
||||||
<linux icon="icons/SCViewer_512x512.xpm"/>
|
<linux icon="icons/SCViewer_512x512.xpm"/>
|
||||||
<macosx icon="icons/SCViewer.icns"/>
|
<macosx icon="icons/SCViewer.icns"/>
|
||||||
|
|
|
@ -29,26 +29,12 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||||
</url>
|
</url>
|
||||||
|
|
||||||
<requires>
|
<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="org.eclipse.osgi.services" version="3.4.0" match="greaterOrEqual"/>
|
||||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.osgi"/>
|
<import plugin="org.eclipse.osgi"/>
|
||||||
<import plugin="com.minres.scviewer.database" version="1.0.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.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>
|
</requires>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
<import plugin="org.eclipse.e4.ui.di" version="1.1.0" match="greaterOrEqual"/>
|
<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="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.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="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.osgi.services" version="3.5.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.e4.core.services" version="2.0.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.equinox.preferences"/>
|
||||||
<import plugin="org.eclipse.core.expressions"/>
|
<import plugin="org.eclipse.core.expressions"/>
|
||||||
<import plugin="org.eclipse.e4.core.commands" version="0.11.0" match="greaterOrEqual"/>
|
<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.core.di.extensions"/>
|
||||||
<import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.10.0" match="greaterOrEqual"/>
|
<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="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="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.executable" version="3.8.700.v20200207-2156"/>
|
||||||
<import feature="org.eclipse.equinox.sdk" version="3.20.100.v20200303-1901"/>
|
<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.sdk" version="4.15.0.v20200305-0155"/>
|
||||||
<import feature="org.eclipse.rcptt.core" version="2.5.1.M3"/>
|
<import feature="org.eclipse.rcptt.core" version="2.5.1.M3"/>
|
||||||
|
<import plugin="org.eclipse.core.commands"/>
|
||||||
</requires>
|
</requires>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
|
|
|
@ -37,8 +37,8 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||||
version="0.0.0"/>
|
version="0.0.0"/>
|
||||||
|
|
||||||
<requires>
|
<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" 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="com.minres.scviewer.database.ui.swt" version="1.0.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.core.runtime"/>
|
<import plugin="org.eclipse.core.runtime"/>
|
||||||
<import plugin="org.eclipse.core.resources"/>
|
<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.core.expressions" version="3.4.600" match="greaterOrEqual"/>
|
||||||
<import plugin="org.eclipse.jface"/>
|
<import plugin="org.eclipse.jface"/>
|
||||||
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
<import plugin="com.google.guava" version="15.0.0" match="greaterOrEqual"/>
|
||||||
<import plugin="org.hamcrest.core" version="1.3.0" match="greaterOrEqual"/>
|
|
||||||
</requires>
|
</requires>
|
||||||
|
|
||||||
<plugin
|
<plugin
|
||||||
|
|
|
@ -17,12 +17,19 @@
|
||||||
[Enter License Description here.]
|
[Enter License Description here.]
|
||||||
</license>
|
</license>
|
||||||
|
|
||||||
<plugin
|
<includes
|
||||||
id="com.minres.scviewer.database.ui"
|
id="com.minres.scviewer.database.feature"
|
||||||
download-size="0"
|
version="0.0.0"/>
|
||||||
install-size="0"
|
|
||||||
version="0.0.0"
|
<requires>
|
||||||
unpack="false"/>
|
<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
|
<plugin
|
||||||
id="com.minres.scviewer.database.ui.swt"
|
id="com.minres.scviewer.database.ui.swt"
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: SWT widget
|
Bundle-Name: SWT widget
|
||||||
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
|
||||||
Bundle-Version: 2.2.0.qualifier
|
Bundle-Version: 2.3.0.qualifier
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||||
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
|
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",
|
com.google.guava;bundle-version="15.0.0",
|
||||||
org.eclipse.jface,
|
org.eclipse.jface,
|
||||||
org.eclipse.equinox.registry,
|
org.eclipse.equinox.registry,
|
||||||
com.minres.scviewer.database.ui,
|
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
org.eclipse.osgi
|
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-ClassPath: .
|
||||||
Bundle-ActivationPolicy: lazy
|
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
|
Automatic-Module-Name: com.minres.scviewer.database.ui.swt
|
||||||
|
|
|
@ -8,5 +8,5 @@
|
||||||
<version>2.0.0-SNAPSHOT</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<relativePath>../..</relativePath>
|
<relativePath>../..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<version>2.2.0-SNAPSHOT</version>
|
<version>2.3.0-SNAPSHOT</version>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -51,7 +51,9 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
|
||||||
|
|
||||||
public void setSelection(ISelection selection);
|
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);
|
public void moveSelection(GotoDirection direction);
|
||||||
|
|
||||||
|
@ -110,4 +112,6 @@ public interface IWaveformView extends PropertyChangeListener, ISelectionProvide
|
||||||
public void scrollHorizontal(int percent);
|
public void scrollHorizontal(int percent);
|
||||||
|
|
||||||
public void addDisposeListener( DisposeListener listener );
|
public void addDisposeListener( DisposeListener listener );
|
||||||
|
|
||||||
|
public void deleteSelectedTracks();
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.minres.scviewer.database.swt;
|
package com.minres.scviewer.database.ui.swt;
|
||||||
|
|
||||||
public class Constants {
|
public class Constants {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.IStatus;
|
||||||
import org.eclipse.core.runtime.Plugin;
|
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.graphics.Point;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
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;
|
import org.eclipse.swt.widgets.Widget;
|
||||||
|
|
|
@ -8,13 +8,13 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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 org.eclipse.swt.widgets.Composite;
|
||||||
|
|
||||||
import com.minres.scviewer.database.swt.internal.WaveformView;
|
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.IWaveformViewFactory;
|
import com.minres.scviewer.database.ui.IWaveformViewFactory;
|
||||||
|
import com.minres.scviewer.database.ui.swt.internal.WaveformView;
|
||||||
|
|
||||||
public class WaveformViewFactory implements IWaveformViewFactory {
|
public class WaveformViewFactory implements IWaveformViewFactory {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.Collection;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.Color;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
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;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -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;
|
import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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;
|
import java.text.DecimalFormat;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.Collection;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -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.SWT;
|
||||||
import org.eclipse.swt.graphics.Point;
|
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.Shell;
|
||||||
import org.eclipse.swt.widgets.Widget;
|
import org.eclipse.swt.widgets.Widget;
|
||||||
|
|
||||||
import com.minres.scviewer.database.swt.Constants;
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
import com.minres.scviewer.database.swt.ToolTipContentProvider;
|
import com.minres.scviewer.database.ui.swt.ToolTipContentProvider;
|
||||||
import com.minres.scviewer.database.swt.ToolTipHelpTextProvider;
|
import com.minres.scviewer.database.ui.swt.ToolTipHelpTextProvider;
|
||||||
|
|
||||||
class ToolTipHandler {
|
class ToolTipHandler {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.Map.Entry;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -40,10 +40,10 @@ import com.google.common.collect.Lists;
|
||||||
import com.minres.scviewer.database.ITx;
|
import com.minres.scviewer.database.ITx;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.RelationType;
|
import com.minres.scviewer.database.RelationType;
|
||||||
import com.minres.scviewer.database.swt.Constants;
|
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
|
|
||||||
public class WaveformCanvas extends Canvas {
|
public class WaveformCanvas extends Canvas {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* MINRES Technologies GmbH - initial API and implementation
|
* 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.awt.Color;
|
||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
|
@ -86,12 +86,12 @@ import com.minres.scviewer.database.ITxRelation;
|
||||||
import com.minres.scviewer.database.ITxStream;
|
import com.minres.scviewer.database.ITxStream;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.RelationType;
|
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.GotoDirection;
|
||||||
import com.minres.scviewer.database.ui.ICursor;
|
import com.minres.scviewer.database.ui.ICursor;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
|
import com.minres.scviewer.database.ui.swt.Constants;
|
||||||
|
|
||||||
public class WaveformView implements IWaveformView {
|
public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
private ITx currentTxSelection;
|
private ITx currentTxSelection;
|
||||||
|
|
||||||
private TrackEntry currentWaveformSelection;
|
private ArrayList<TrackEntry> currentWaveformSelection = new ArrayList<>();
|
||||||
|
|
||||||
private ScrolledComposite nameListScrolled;
|
private ScrolledComposite nameListScrolled;
|
||||||
|
|
||||||
|
@ -133,18 +133,41 @@ public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
private Font nameFont, nameFontB;
|
private Font nameFont, nameFontB;
|
||||||
|
|
||||||
|
protected TrackEntry lastClickedEntry;
|
||||||
|
|
||||||
protected MouseListener nameValueMouseListener = new MouseAdapter() {
|
protected MouseListener nameValueMouseListener = new MouseAdapter() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void mouseDown(MouseEvent e) {
|
public void mouseDown(MouseEvent e) {
|
||||||
if (e.button == 1) {
|
if (e.button == 1) {
|
||||||
Entry<Integer, TrackEntry> entry = trackVerticalOffset.floorEntry(e.y);
|
Entry<Integer, TrackEntry> entry = trackVerticalOffset.floorEntry(e.y);
|
||||||
if (entry != null)
|
entry.getValue().selected=true;
|
||||||
setSelection(new StructuredSelection(entry.getValue()));
|
|
||||||
} else if (e.button == 3) {
|
} else if (e.button == 3) {
|
||||||
Menu topMenu= top.getMenu();
|
Menu topMenu= top.getMenu();
|
||||||
if(topMenu!=null) topMenu.setVisible(true);
|
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 MouseMoveListener, MouseListener, PaintListener {
|
||||||
|
@ -457,7 +480,7 @@ public class WaveformView implements IWaveformView {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
update();
|
update();
|
||||||
waveformCanvas.reveal(currentWaveformSelection.waveform);
|
currentWaveformSelection.stream().forEach(e -> waveformCanvas.reveal(e.waveform));
|
||||||
valueList.redraw();
|
valueList.redraw();
|
||||||
nameList.redraw();
|
nameList.redraw();
|
||||||
}
|
}
|
||||||
|
@ -480,13 +503,11 @@ public class WaveformView implements IWaveformView {
|
||||||
trackVerticalOffset.clear();
|
trackVerticalOffset.clear();
|
||||||
waveformCanvas.clearAllWaveformPainter(false);
|
waveformCanvas.clearAllWaveformPainter(false);
|
||||||
boolean even = true;
|
boolean even = true;
|
||||||
boolean clearSelection = true;
|
|
||||||
TextLayout tl = new TextLayout(waveformCanvas.getDisplay());
|
TextLayout tl = new TextLayout(waveformCanvas.getDisplay());
|
||||||
tl.setFont(nameFontB);
|
tl.setFont(nameFontB);
|
||||||
for (TrackEntry streamEntry : streams) {
|
for (TrackEntry streamEntry : streams) {
|
||||||
streamEntry.height = waveformCanvas.getTrackHeight();
|
streamEntry.height = waveformCanvas.getTrackHeight();
|
||||||
streamEntry.vOffset=trackVerticalHeight;
|
streamEntry.vOffset=trackVerticalHeight;
|
||||||
clearSelection &= currentWaveformSelection!=null && (streamEntry.waveform != currentWaveformSelection.waveform);
|
|
||||||
if (streamEntry.isStream()) {
|
if (streamEntry.isStream()) {
|
||||||
streamEntry.currentValue="";
|
streamEntry.currentValue="";
|
||||||
streamEntry.height *= streamEntry.getStream().getMaxConcurrency();
|
streamEntry.height *= streamEntry.getStream().getMaxConcurrency();
|
||||||
|
@ -512,7 +533,6 @@ public class WaveformView implements IWaveformView {
|
||||||
if (trackVerticalOffset.isEmpty()){
|
if (trackVerticalOffset.isEmpty()){
|
||||||
waveformCanvas.setOrigin(0, 0);
|
waveformCanvas.setOrigin(0, 0);
|
||||||
}
|
}
|
||||||
if(clearSelection) setSelection(new StructuredSelection());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int calculateValueWidth() {
|
private int calculateValueWidth() {
|
||||||
|
@ -651,11 +671,12 @@ public class WaveformView implements IWaveformView {
|
||||||
@Override
|
@Override
|
||||||
public ISelection getSelection() {
|
public ISelection getSelection() {
|
||||||
if (currentTxSelection != null) {
|
if (currentTxSelection != null) {
|
||||||
Object[] elem = {currentTxSelection, currentWaveformSelection};
|
ArrayList<Object> sel = new ArrayList<>();
|
||||||
return new StructuredSelection(elem);
|
sel.add(currentTxSelection);
|
||||||
} else if (currentWaveformSelection != null) {
|
sel.addAll(currentWaveformSelection.stream().map(e -> e.waveform).collect(Collectors.toList()));
|
||||||
Object[] elem = {currentWaveformSelection.waveform, currentWaveformSelection};
|
return new StructuredSelection(sel.toArray());
|
||||||
return new StructuredSelection(elem);
|
} else if (currentWaveformSelection.size()>0) {
|
||||||
|
return new StructuredSelection(currentWaveformSelection.toArray());
|
||||||
} else
|
} else
|
||||||
return new StructuredSelection();
|
return new StructuredSelection();
|
||||||
}
|
}
|
||||||
|
@ -665,22 +686,33 @@ public class WaveformView implements IWaveformView {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setSelection(ISelection selection) {
|
public void setSelection(ISelection selection) {
|
||||||
setSelection(selection, false);
|
setSelection(selection, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
|
* @see com.minres.scviewer.database.swt.IWaveformPanel#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
|
||||||
*/
|
*/
|
||||||
@Override
|
@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;
|
boolean selectionChanged = false;
|
||||||
if(currentWaveformSelection!=null) currentWaveformSelection.selected=false;
|
currentWaveformSelection.forEach(e->e.selected=false);
|
||||||
if (selection instanceof IStructuredSelection) {
|
if (selection instanceof IStructuredSelection) {
|
||||||
if(((IStructuredSelection) selection).size()==0){
|
if(((IStructuredSelection) selection).size()==0){
|
||||||
selectionChanged = currentTxSelection!=null||currentWaveformSelection!=null;
|
selectionChanged = currentTxSelection!=null||currentWaveformSelection!=null;
|
||||||
currentTxSelection = null;
|
currentTxSelection = null;
|
||||||
currentWaveformSelection = null;
|
currentWaveformSelection .clear();
|
||||||
} else {
|
} else {
|
||||||
|
if(!add) currentWaveformSelection.clear();
|
||||||
for(Object sel:((IStructuredSelection) selection).toArray()){
|
for(Object sel:((IStructuredSelection) selection).toArray()){
|
||||||
if (sel instanceof ITx && currentTxSelection != sel){
|
if (sel instanceof ITx && currentTxSelection != sel){
|
||||||
ITx txSel = (ITx) sel;
|
ITx txSel = (ITx) sel;
|
||||||
|
@ -693,26 +725,27 @@ public class WaveformView implements IWaveformView {
|
||||||
streams.add(trackEntry);
|
streams.add(trackEntry);
|
||||||
}
|
}
|
||||||
currentTxSelection = txSel;
|
currentTxSelection = txSel;
|
||||||
if(trackEntry!=null) currentWaveformSelection = trackEntry;
|
if(trackEntry!=null) {
|
||||||
|
currentWaveformSelection.add((TrackEntry)sel);
|
||||||
|
}
|
||||||
selectionChanged = true;
|
selectionChanged = true;
|
||||||
} else if (sel instanceof TrackEntry && currentWaveformSelection != sel) {
|
} else if (sel instanceof TrackEntry && !currentWaveformSelection.contains(sel)) {
|
||||||
currentWaveformSelection = (TrackEntry) sel;
|
currentWaveformSelection.add((TrackEntry)sel);
|
||||||
if(currentTxSelection!=null && currentTxSelection.getStream()!=currentWaveformSelection)
|
if(currentTxSelection!=null)
|
||||||
currentTxSelection=null;
|
currentTxSelection=null;
|
||||||
|
|
||||||
selectionChanged = true;
|
selectionChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (currentTxSelection != null || currentWaveformSelection != null)
|
if (currentTxSelection != null || currentWaveformSelection.size() > 0)
|
||||||
selectionChanged = true;
|
selectionChanged = true;
|
||||||
currentTxSelection = null;
|
currentTxSelection = null;
|
||||||
currentWaveformSelection = null;
|
currentWaveformSelection.clear();
|
||||||
}
|
}
|
||||||
if(currentWaveformSelection!=null) currentWaveformSelection.selected=true;
|
currentWaveformSelection.forEach(e -> e.selected = true);
|
||||||
if (selectionChanged) {
|
if (selectionChanged) {
|
||||||
if(currentWaveformSelection!=null) waveformCanvas.reveal(currentWaveformSelection.waveform);
|
currentWaveformSelection.forEach(e -> waveformCanvas.reveal(e.waveform));
|
||||||
waveformCanvas.setSelected(currentTxSelection);
|
waveformCanvas.setSelected(currentTxSelection);
|
||||||
valueList.redraw();
|
valueList.redraw();
|
||||||
nameList.redraw();
|
nameList.redraw();
|
||||||
|
@ -722,9 +755,7 @@ public class WaveformView implements IWaveformView {
|
||||||
|
|
||||||
protected void fireSelectionChanged() {
|
protected void fireSelectionChanged() {
|
||||||
if(currentWaveformSelection==null) return;
|
if(currentWaveformSelection==null) return;
|
||||||
IStructuredSelection selection=currentTxSelection!=null?
|
ISelection selection=getSelection();
|
||||||
new StructuredSelection(new Object[]{currentTxSelection, currentWaveformSelection.waveform}):
|
|
||||||
new StructuredSelection(currentWaveformSelection.waveform);
|
|
||||||
Object[] list = selectionChangedListeners.getListeners();
|
Object[] list = selectionChangedListeners.getListeners();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection));
|
((ISelectionChangedListener) list[i]).selectionChanged(new SelectionChangedEvent(this, selection));
|
||||||
|
@ -739,7 +770,8 @@ public class WaveformView implements IWaveformView {
|
||||||
if(direction==GotoDirection.NEXT || direction==GotoDirection.PREV)
|
if(direction==GotoDirection.NEXT || direction==GotoDirection.PREV)
|
||||||
moveSelection(direction, NEXT_PREV_IN_STREAM) ;
|
moveSelection(direction, NEXT_PREV_IN_STREAM) ;
|
||||||
else {
|
else {
|
||||||
int idx = streams.indexOf(currentWaveformSelection);
|
if(currentWaveformSelection.size()==1) {
|
||||||
|
int idx = streams.indexOf(currentWaveformSelection.get(0));
|
||||||
if(direction==GotoDirection.UP && idx>0) {
|
if(direction==GotoDirection.UP && idx>0) {
|
||||||
setSelection(new StructuredSelection(streams.get(idx-1)));
|
setSelection(new StructuredSelection(streams.get(idx-1)));
|
||||||
} else if(direction==GotoDirection.DOWN && idx<(streams.size()-1)) {
|
} else if(direction==GotoDirection.DOWN && idx<(streams.size()-1)) {
|
||||||
|
@ -747,15 +779,22 @@ public class WaveformView implements IWaveformView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelection(com.minres.scviewer.database.swt.GotoDirection, com.minres.scviewer.database.RelationType)
|
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelection(com.minres.scviewer.database.swt.GotoDirection, com.minres.scviewer.database.RelationType)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void moveSelection(GotoDirection direction, RelationType relationType) {
|
public void moveSelection(GotoDirection direction, RelationType relationType) {
|
||||||
if (currentWaveformSelection!=null && currentWaveformSelection.isStream() && currentTxSelection!=null) {
|
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)){
|
if(relationType.equals(IWaveformView.NEXT_PREV_IN_STREAM)){
|
||||||
ITxStream<? extends ITxEvent> stream = currentWaveformSelection.getStream();
|
ITxStream<? extends ITxEvent> stream = selectedWaveform.getStream();
|
||||||
ITx transaction = null;
|
ITx transaction = null;
|
||||||
if (direction == GotoDirection.NEXT) {
|
if (direction == GotoDirection.NEXT) {
|
||||||
List<ITxEvent> thisEntryList = stream.getEvents().get(currentTxSelection.getBeginTime());
|
List<ITxEvent> thisEntryList = stream.getEvents().get(currentTxSelection.getBeginTime());
|
||||||
|
@ -855,14 +894,14 @@ public class WaveformView implements IWaveformView {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void moveCursor(GotoDirection direction) {
|
public void moveCursor(GotoDirection direction) {
|
||||||
|
if(currentWaveformSelection.size()!=1) return;
|
||||||
|
TrackEntry sel = currentWaveformSelection.get(1);
|
||||||
long time = getCursorTime();
|
long time = getCursorTime();
|
||||||
NavigableMap<Long, ?> map=null;
|
NavigableMap<Long, ?> map=null;
|
||||||
if(currentWaveformSelection!=null) {
|
if(sel.isStream()){
|
||||||
if(currentWaveformSelection.isStream()){
|
map=sel.getStream().getEvents();
|
||||||
map=currentWaveformSelection.getStream().getEvents();
|
} else if(sel.isSignal()){
|
||||||
} else if(currentWaveformSelection.isSignal()){
|
map=sel.getSignal().getEvents();
|
||||||
map=currentWaveformSelection.getSignal().getEvents();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(map!=null){
|
if(map!=null){
|
||||||
Entry<Long, ?> entry=direction==GotoDirection.PREV?map.lowerEntry(time):map.higherEntry(time);
|
Entry<Long, ?> entry=direction==GotoDirection.PREV?map.lowerEntry(time):map.higherEntry(time);
|
||||||
|
@ -884,29 +923,37 @@ public class WaveformView implements IWaveformView {
|
||||||
public List<TrackEntry> getStreamList() {
|
public List<TrackEntry> getStreamList() {
|
||||||
return streams;
|
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)
|
/* (non-Javadoc)
|
||||||
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelected(int)
|
* @see com.minres.scviewer.database.swt.IWaveformPanel#moveSelected(int)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void moveSelectedTrack(int i) {
|
public void moveSelectedTrack(int i) {
|
||||||
if(currentWaveformSelection!=null){
|
if(currentWaveformSelection.size()>0){
|
||||||
int idx = streams.indexOf(currentWaveformSelection);
|
int idx = streams.indexOf(currentWaveformSelection.get(0));
|
||||||
int newIdx=idx+i;
|
for(Object o: currentWaveformSelection)
|
||||||
if(newIdx>=0 && newIdx<streams.size()){
|
streams.remove(o);
|
||||||
Collections.swap(streams,idx,newIdx);
|
int tgtIdx=idx+i;
|
||||||
revealSelected=true;
|
if(tgtIdx<0) tgtIdx=0;
|
||||||
// update();
|
if(tgtIdx>=streams.size())
|
||||||
// ITx selectedTx=currentTxSelection;
|
streams.addAll(currentWaveformSelection);
|
||||||
// if(selectedTx!=null){
|
else
|
||||||
// setSelection(new StructuredSelection(new Object[]{selectedTx, currentWaveformSelection.waveform}));
|
streams.addAll(tgtIdx, currentWaveformSelection);
|
||||||
// } else {
|
|
||||||
// setSelection(new StructuredSelection(currentWaveformSelection.waveform));
|
|
||||||
// }
|
|
||||||
// waveformCanvas.reveal(currentWaveformSelection.waveform);
|
|
||||||
// valueList.redraw();
|
|
||||||
// nameList.redraw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1108,38 +1155,30 @@ public class WaveformView implements IWaveformView {
|
||||||
dropTarget.setTransfer(types);
|
dropTarget.setTransfer(types);
|
||||||
|
|
||||||
dropTarget.addDropListener(new DropTargetAdapter() {
|
dropTarget.addDropListener(new DropTargetAdapter() {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void drop(DropTargetEvent event) {
|
public void drop(DropTargetEvent event) {
|
||||||
if (LocalSelectionTransfer.getTransfer().isSupportedType(event.currentDataType)){
|
if (LocalSelectionTransfer.getTransfer().isSupportedType(event.currentDataType)){
|
||||||
ISelection sel = LocalSelectionTransfer.getTransfer().getSelection();
|
ISelection s = LocalSelectionTransfer.getTransfer().getSelection();
|
||||||
if(sel!=null && sel instanceof IStructuredSelection){
|
if(s!=null && s instanceof IStructuredSelection){
|
||||||
Object source = ((IStructuredSelection)sel).getFirstElement();
|
IStructuredSelection sel = (IStructuredSelection) s;
|
||||||
|
for(Object o: sel.toList())
|
||||||
|
streams.remove(o);
|
||||||
DropTarget tgt = (DropTarget) event.widget;
|
DropTarget tgt = (DropTarget) event.widget;
|
||||||
Point dropPoint = ((Canvas) tgt.getControl()).toControl(event.x, event.y);
|
Point dropPoint = ((Canvas) tgt.getControl()).toControl(event.x, event.y);
|
||||||
Object target = trackVerticalOffset.floorEntry(dropPoint.y).getValue();
|
// extract all elements being selected
|
||||||
if(source instanceof TrackEntry && target instanceof TrackEntry){
|
if( dropPoint.y > trackVerticalOffset.lastKey()) {
|
||||||
TrackEntry srcWave=(TrackEntry) source;
|
streams.addAll(sel.toList());
|
||||||
int srcIdx=streams.indexOf(srcWave);
|
} else {
|
||||||
streams.remove(srcWave);
|
TrackEntry target = trackVerticalOffset.floorEntry(dropPoint.y).getValue();
|
||||||
int tgtIdx=streams.indexOf(target);
|
int tgtIdx=streams.indexOf(target);
|
||||||
if(srcIdx<=tgtIdx) tgtIdx++;
|
streams.addAll(tgtIdx, sel.toList());
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void dropAccept(DropTargetEvent event) {
|
public void dropAccept(DropTargetEvent event) {
|
||||||
Point offset = canvas.toControl(event.x, event.y);
|
if (event.detail != DND.DROP_MOVE) {
|
||||||
if (event.detail != DND.DROP_MOVE || offset.y > trackVerticalOffset.lastKey() + waveformCanvas.getTrackHeight()) {
|
|
||||||
event.detail = DND.DROP_NONE;
|
event.detail = DND.DROP_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1350,4 +1389,5 @@ public class WaveformView implements IWaveformView {
|
||||||
public void addDisposeListener( DisposeListener listener ) {
|
public void addDisposeListener( DisposeListener listener ) {
|
||||||
waveformCanvas.addDisposeListener(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,2 +0,0 @@
|
||||||
/bin/
|
|
||||||
/target/
|
|
|
@ -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>
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %Bundle-Name
|
Bundle-Name: %Bundle-Name
|
||||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
|
||||||
Bundle-Version: 2.6.1.qualifier
|
Bundle-Version: 2.7.0.qualifier
|
||||||
Bundle-Vendor: %Bundle-Vendor
|
Bundle-Vendor: %Bundle-Vendor
|
||||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
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.ui.di;bundle-version="1.1.0",
|
||||||
org.eclipse.e4.core.contexts;bundle-version="1.4.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.swt;bundle-version="1.0.0",
|
||||||
com.minres.scviewer.database.ui,
|
|
||||||
com.minres.scviewer.database;bundle-version="1.0.0",
|
com.minres.scviewer.database;bundle-version="1.0.0",
|
||||||
org.eclipse.osgi.services;bundle-version="3.5.0",
|
org.eclipse.osgi.services;bundle-version="3.5.0",
|
||||||
org.eclipse.e4.core.services;bundle-version="2.0.0",
|
org.eclipse.e4.core.services;bundle-version="2.0.0",
|
||||||
|
|
|
@ -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">
|
<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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
<artifactId>com.minres.scviewer.e4.application</artifactId>
|
||||||
<version>2.6.1-SNAPSHOT</version>
|
<version>2.7.0-SNAPSHOT</version>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.minres.scviewer</groupId>
|
<groupId>com.minres.scviewer</groupId>
|
||||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
package com.minres.scviewer.e4.application.elements;
|
package com.minres.scviewer.e4.application.elements;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
@ -34,22 +33,46 @@ public class WaveformPopupMenuContribution {
|
||||||
|
|
||||||
final TrackEntry nullEntry = new TrackEntry(null);
|
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
|
@Evaluate
|
||||||
public boolean evaluate() {
|
public boolean evaluate() {
|
||||||
Object obj = activePart.getObject();
|
Object obj = activePart.getObject();
|
||||||
if(obj instanceof WaveformViewer){
|
if(obj instanceof WaveformViewer){
|
||||||
WaveformViewer wfv = (WaveformViewer)obj;
|
WaveformViewer wfv = (WaveformViewer)obj;
|
||||||
ISelection sel = wfv.getSelection();
|
return selHasBitVector(wfv.getSelection(), true);
|
||||||
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 false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -60,39 +83,24 @@ public class WaveformPopupMenuContribution {
|
||||||
if(obj instanceof WaveformViewer){
|
if(obj instanceof WaveformViewer){
|
||||||
WaveformViewer wfv = (WaveformViewer)obj;
|
WaveformViewer wfv = (WaveformViewer)obj;
|
||||||
ISelection sel = wfv.getSelection();
|
ISelection sel = wfv.getSelection();
|
||||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
TrackEntry elem = getSingleTrackEntry(sel);
|
||||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
if(selHasBitVector(sel, false)) {
|
||||||
Object first = it.next();
|
addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, elem);
|
||||||
Object second=null;
|
addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, elem);
|
||||||
if(it.hasNext()) second=it.next();
|
addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, elem);
|
||||||
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);
|
|
||||||
items.add(MMenuFactory.INSTANCE.createMenuSeparator());
|
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 step-wise", TrackEntry.WaveDisplay.STEP_WISE, elem);
|
||||||
addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, entry.waveDisplay);
|
addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, elem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addValueMenuItem(List<MMenuElement> items, MApplication application, EModelService modelService,
|
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();
|
MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
|
||||||
item.setType(ItemType.RADIO);
|
item.setType(ItemType.RADIO);
|
||||||
item.setSelected(value==actual);
|
item.setSelected(elem != null && elem.valueDisplay == value);
|
||||||
item.setLabel("Show as "+label);
|
item.setLabel("Show as "+label);
|
||||||
item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
|
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);
|
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,
|
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();
|
MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
|
||||||
item.setType(ItemType.RADIO);
|
item.setType(ItemType.RADIO);
|
||||||
item.setSelected(value==actual);
|
item.setSelected(elem != null && elem.waveDisplay==value);
|
||||||
item.setLabel("Render "+label);
|
item.setLabel("Render "+label);
|
||||||
item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
|
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);
|
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;
|
package com.minres.scviewer.e4.application.handlers;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||||
|
@ -34,18 +32,14 @@ public class ChangeValueDisplay {
|
||||||
WaveformViewer wfv = (WaveformViewer)obj;
|
WaveformViewer wfv = (WaveformViewer)obj;
|
||||||
ISelection sel = wfv.getSelection();
|
ISelection sel = wfv.getSelection();
|
||||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
for(Object elem:(IStructuredSelection)sel) {
|
||||||
it.next();
|
if(elem instanceof TrackEntry) {
|
||||||
if(it.hasNext()) {
|
TrackEntry.ValueDisplay val= TrackEntry.ValueDisplay.valueOf(param);
|
||||||
Object second = it.next();
|
((TrackEntry)elem).valueDisplay=val;
|
||||||
if(second instanceof TrackEntry) {
|
}
|
||||||
TrackEntry.ValueDisplay val = TrackEntry.ValueDisplay.valueOf(param);
|
}
|
||||||
((TrackEntry)second).valueDisplay=val;
|
|
||||||
wfv.update();
|
wfv.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
|
|
||||||
package com.minres.scviewer.e4.application.handlers;
|
package com.minres.scviewer.e4.application.handlers;
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||||
|
@ -34,18 +32,15 @@ public class ChangeWaveformDisplay {
|
||||||
WaveformViewer wfv = (WaveformViewer)obj;
|
WaveformViewer wfv = (WaveformViewer)obj;
|
||||||
ISelection sel = wfv.getSelection();
|
ISelection sel = wfv.getSelection();
|
||||||
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
if(!sel.isEmpty() && sel instanceof IStructuredSelection) {
|
||||||
Iterator<?> it = ((IStructuredSelection)sel).iterator();
|
for(Object elem:(IStructuredSelection)sel) {
|
||||||
it.next();
|
if(elem instanceof TrackEntry) {
|
||||||
if(it.hasNext()) {
|
|
||||||
Object second = it.next();
|
|
||||||
if(second instanceof TrackEntry) {
|
|
||||||
TrackEntry.WaveDisplay val= TrackEntry.WaveDisplay.valueOf(param);
|
TrackEntry.WaveDisplay val= TrackEntry.WaveDisplay.valueOf(param);
|
||||||
((TrackEntry)second).waveDisplay=val;
|
((TrackEntry)elem).waveDisplay=val;
|
||||||
|
}
|
||||||
|
}
|
||||||
wfv.update();
|
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.e4.ui.workbench.modeling.ESelectionService;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
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;
|
import com.minres.scviewer.e4.application.parts.WaveformViewer;
|
||||||
|
|
||||||
public class DeleteWaveformHandler {
|
public class DeleteWaveformHandler {
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@CanExecute
|
@CanExecute
|
||||||
public Boolean canExecute(ESelectionService selectionService){
|
public Boolean canExecute(ESelectionService selectionService){
|
||||||
Object o = selectionService.getSelection();
|
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
|
@Execute
|
||||||
public void execute(ESelectionService selectionService, MPart activePart) {
|
public void execute(ESelectionService selectionService, MPart activePart) {
|
||||||
Object o = activePart.getObject();
|
Object o = activePart.getObject();
|
||||||
Object sel = selectionService.getSelection();
|
if(o instanceof WaveformViewer){
|
||||||
if(o instanceof WaveformViewer && ((IStructuredSelection)sel).getFirstElement() instanceof IWaveform){
|
((WaveformViewer)o).removeSelectedStreamsFromList();
|
||||||
((WaveformViewer)o).removeStreamFromList((IWaveform) ((IStructuredSelection)sel).getFirstElement());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -90,16 +90,16 @@ import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
import com.minres.scviewer.database.IWaveformDb;
|
||||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
import com.minres.scviewer.database.IWaveformDbFactory;
|
||||||
import com.minres.scviewer.database.RelationType;
|
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.WaveformViewFactory;
|
|
||||||
import com.minres.scviewer.database.ui.GotoDirection;
|
import com.minres.scviewer.database.ui.GotoDirection;
|
||||||
import com.minres.scviewer.database.ui.ICursor;
|
import com.minres.scviewer.database.ui.ICursor;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.ValueDisplay;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
import com.minres.scviewer.database.ui.TrackEntry.WaveDisplay;
|
||||||
|
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.database.ui.WaveformColors;
|
import com.minres.scviewer.database.ui.WaveformColors;
|
||||||
import com.minres.scviewer.e4.application.Messages;
|
import com.minres.scviewer.e4.application.Messages;
|
||||||
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
import com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl;
|
||||||
|
@ -1005,55 +1005,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||||
setFocus();
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void removeSelectedStreamsFromList() {
|
||||||
* Removes the stream from list.
|
waveformPane.deleteSelectedTracks();
|
||||||
*
|
|
||||||
* @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 removeStreamFromList(ISelection sel) {
|
||||||
* Removes the streams from list.
|
waveformPane.deleteSelectedTracks();
|
||||||
*
|
|
||||||
* @param iWaveforms the i waveforms
|
|
||||||
*/
|
|
||||||
public void removeStreamsFromList(IWaveform[] iWaveforms) {
|
|
||||||
for (IWaveform stream : iWaveforms)
|
|
||||||
removeStreamFromList(stream);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move selected.
|
* Move selected.
|
||||||
*
|
*
|
||||||
|
|
|
@ -68,7 +68,9 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
if(inputElement instanceof IHierNode){
|
if(inputElement instanceof IWaveformDb){
|
||||||
|
return new Object[]{};
|
||||||
|
}else if(inputElement instanceof IHierNode){
|
||||||
Collection<IHierNode> res = Collections2.filter(((IHierNode)inputElement).getChildNodes(), new Predicate<IHierNode>(){
|
Collection<IHierNode> res = Collections2.filter(((IHierNode)inputElement).getChildNodes(), new Predicate<IHierNode>(){
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(IHierNode arg0) {
|
public boolean apply(IHierNode arg0) {
|
||||||
|
@ -82,8 +84,6 @@ public class TxDbContentProvider implements ITreeContentProvider {
|
||||||
return res.toArray();
|
return res.toArray();
|
||||||
}else if(inputElement instanceof List<?>){
|
}else if(inputElement instanceof List<?>){
|
||||||
return ((List<?>)inputElement).toArray();
|
return ((List<?>)inputElement).toArray();
|
||||||
}else if(inputElement instanceof IWaveformDb){
|
|
||||||
return new Object[]{};
|
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ Bundle-Version: 1.0.1.qualifier
|
||||||
Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin
|
Bundle-Activator: com.minres.scviewer.ui.TxEditorPlugin
|
||||||
Bundle-Vendor: MINRES Technologies GmbH
|
Bundle-Vendor: MINRES Technologies GmbH
|
||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
|
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",
|
com.minres.scviewer.database.ui.swt;bundle-version="1.0.0",
|
||||||
org.eclipse.core.runtime,
|
org.eclipse.core.runtime,
|
||||||
org.eclipse.core.resources,
|
org.eclipse.core.resources,
|
||||||
|
|
|
@ -48,10 +48,10 @@ import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
|
||||||
import com.minres.scviewer.database.IWaveform;
|
import com.minres.scviewer.database.IWaveform;
|
||||||
import com.minres.scviewer.database.IWaveformDb;
|
import com.minres.scviewer.database.IWaveformDb;
|
||||||
import com.minres.scviewer.database.IWaveformDbFactory;
|
import com.minres.scviewer.database.IWaveformDbFactory;
|
||||||
import com.minres.scviewer.database.swt.WaveformViewFactory;
|
|
||||||
import com.minres.scviewer.database.ui.GotoDirection;
|
import com.minres.scviewer.database.ui.GotoDirection;
|
||||||
import com.minres.scviewer.database.ui.IWaveformView;
|
import com.minres.scviewer.database.ui.IWaveformView;
|
||||||
import com.minres.scviewer.database.ui.TrackEntry;
|
import com.minres.scviewer.database.ui.TrackEntry;
|
||||||
|
import com.minres.scviewer.database.ui.swt.WaveformViewFactory;
|
||||||
import com.minres.scviewer.ui.views.TxOutlinePage;
|
import com.minres.scviewer.ui.views.TxOutlinePage;
|
||||||
|
|
||||||
public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor {
|
public class TxEditorPart extends EditorPart implements ITabbedPropertySheetPageContributor {
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -13,7 +13,6 @@
|
||||||
<module>plugins/com.minres.scviewer.database.text</module>
|
<module>plugins/com.minres.scviewer.database.text</module>
|
||||||
<module>plugins/com.minres.scviewer.database.vcd</module>
|
<module>plugins/com.minres.scviewer.database.vcd</module>
|
||||||
<module>tests/com.minres.scviewer.database.test</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.database.ui.swt</module>
|
||||||
<module>plugins/com.minres.scviewer.e4.application</module>
|
<module>plugins/com.minres.scviewer.e4.application</module>
|
||||||
<module>plugins/com.minres.scviewer.ui</module>
|
<module>plugins/com.minres.scviewer.ui</module>
|
||||||
|
|
Loading…
Reference in New Issue