Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
45c23564b5 | |||
ab975eadd1 | |||
7ad70411f3 | |||
24720340be | |||
ad51066f1c | |||
95e2db60b6 | |||
db1d377da6 | |||
230e8dcc7a | |||
ab2146102f | |||
b1148922d8 |
20
.project
20
.project
@ -1,16 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>scviewer.parent</name>
|
||||
<name>com.minres.scviewer.parent</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1591076960924</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
@ -19,7 +25,7 @@
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1591076960932</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
@ -28,7 +34,7 @@
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1591076960936</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
@ -37,7 +43,7 @@
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1591076960939</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
@ -46,7 +52,7 @@
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1591076960950</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
@ -55,7 +61,7 @@
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1591076960954</id>
|
||||
<id>0</id>
|
||||
<name></name>
|
||||
<type>10</type>
|
||||
<matcher>
|
||||
|
4
.settings/org.eclipse.m2e.core.prefs
Normal file
4
.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -1,104 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
|
||||
<booleanAttribute key="append.args" value="true"/>
|
||||
<stringAttribute key="application" value="org.eclipse.pde.junit.runtime.coretestapplication"/>
|
||||
<booleanAttribute key="askclear" value="false"/>
|
||||
<booleanAttribute key="automaticAdd" value="true"/>
|
||||
<booleanAttribute key="automaticValidate" value="false"/>
|
||||
<stringAttribute key="bootstrap" value=""/>
|
||||
<stringAttribute key="checked" value="[NONE]"/>
|
||||
<booleanAttribute key="clearConfig" value="true"/>
|
||||
<booleanAttribute key="clearws" value="true"/>
|
||||
<booleanAttribute key="clearwslog" value="false"/>
|
||||
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
|
||||
<booleanAttribute key="default" value="true"/>
|
||||
<setAttribute key="deselected_workspace_bundles">
|
||||
<setEntry value="com.minres.scviewer.e4.application"/>
|
||||
<setEntry value="com.minres.scviewer.ui"/>
|
||||
</setAttribute>
|
||||
<booleanAttribute key="includeOptional" value="true"/>
|
||||
<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/com.minres.scviewer.database.test"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="4"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=com.minres.scviewer.database.test"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.minres.scviewer.database.test"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx512m"/>
|
||||
<stringAttribute key="pde.version" value="3.3"/>
|
||||
<stringAttribute key="product" value="com.minres.scviewer.e4.product"/>
|
||||
<booleanAttribute key="run_in_ui_thread" value="true"/>
|
||||
<setAttribute key="selected_target_bundles">
|
||||
<setEntry value="com.google.guava@default:default"/>
|
||||
<setEntry value="javax.annotation@default:default"/>
|
||||
<setEntry value="javax.inject@default:default"/>
|
||||
<setEntry value="javax.servlet@default:default"/>
|
||||
<setEntry value="org.apache.ant@default:default"/>
|
||||
<setEntry value="org.apache.commons.jxpath@default:default"/>
|
||||
<setEntry value="org.apache.felix.gogo.command@default:default"/>
|
||||
<setEntry value="org.apache.felix.gogo.runtime@default:default"/>
|
||||
<setEntry value="org.codehaus.groovy@default:default"/>
|
||||
<setEntry value="org.eclipse.ant.core@default:default"/>
|
||||
<setEntry value="org.eclipse.core.commands@default:default"/>
|
||||
<setEntry value="org.eclipse.core.contenttype@default:default"/>
|
||||
<setEntry value="org.eclipse.core.expressions@default:default"/>
|
||||
<setEntry value="org.eclipse.core.filesystem.macosx@default:false"/>
|
||||
<setEntry value="org.eclipse.core.filesystem@default:default"/>
|
||||
<setEntry value="org.eclipse.core.jobs@default:default"/>
|
||||
<setEntry value="org.eclipse.core.resources@default:default"/>
|
||||
<setEntry value="org.eclipse.core.runtime@default:true"/>
|
||||
<setEntry value="org.eclipse.core.variables@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.core.contexts@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.core.di.annotations@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.core.di.extensions@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.core.di@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.core.services@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.emf.xpath@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.ui.di@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.ui.model.workbench@default:default"/>
|
||||
<setEntry value="org.eclipse.e4.ui.services@default:default"/>
|
||||
<setEntry value="org.eclipse.emf.common@default:default"/>
|
||||
<setEntry value="org.eclipse.emf.ecore@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.app@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.bidi@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.common@2:true"/>
|
||||
<setEntry value="org.eclipse.equinox.ds@1:true"/>
|
||||
<setEntry value="org.eclipse.equinox.preferences@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.registry@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.util@default:default"/>
|
||||
<setEntry value="org.eclipse.jface@default:default"/>
|
||||
<setEntry value="org.eclipse.osgi.compatibility.state@default:false"/>
|
||||
<setEntry value="org.eclipse.osgi.services@default:default"/>
|
||||
<setEntry value="org.eclipse.osgi@-1:true"/>
|
||||
<setEntry value="org.eclipse.swt.cocoa.macosx.x86_64@default:false"/>
|
||||
<setEntry value="org.eclipse.swt@default:default"/>
|
||||
<setEntry value="org.hamcrest.core@default:default"/>
|
||||
<setEntry value="org.junit@default:default"/>
|
||||
</setAttribute>
|
||||
<setAttribute key="selected_workspace_bundles">
|
||||
<setEntry value="com.minres.scviewer.database.sqlite@default:true"/>
|
||||
<setEntry value="com.minres.scviewer.database.test@default:default"/>
|
||||
<setEntry value="com.minres.scviewer.database.text@default:true"/>
|
||||
<setEntry value="com.minres.scviewer.database.ui.swt@default:default"/>
|
||||
<setEntry value="com.minres.scviewer.database.ui@default:default"/>
|
||||
<setEntry value="com.minres.scviewer.database.vcd@default:default"/>
|
||||
<setEntry value="com.minres.scviewer.database@default:true"/>
|
||||
<setEntry value="com.opcoach.e4.preferences@default:default"/>
|
||||
</setAttribute>
|
||||
<booleanAttribute key="show_selected_only" value="false"/>
|
||||
<booleanAttribute key="tracing" value="false"/>
|
||||
<booleanAttribute key="useCustomFeatures" value="false"/>
|
||||
<booleanAttribute key="useDefaultConfig" value="true"/>
|
||||
<booleanAttribute key="useDefaultConfigArea" value="false"/>
|
||||
<booleanAttribute key="useProduct" value="false"/>
|
||||
</launchConfiguration>
|
@ -10,7 +10,7 @@
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>com.minres.scviewer.e4.product</artifactId>
|
||||
<version>2.6.0-SNAPSHOT</version>
|
||||
<version>2.6.1-SNAPSHOT</version>
|
||||
<packaging>eclipse-repository</packaging>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<build>
|
||||
|
@ -1,19 +1,23 @@
|
||||
<?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.0.qualifier" useFeatures="false" includeLaunchers="true">
|
||||
<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">
|
||||
|
||||
<configIni use="default">
|
||||
</configIni>
|
||||
|
||||
<launcherArgs>
|
||||
<programArgs>-clearPersistedState</programArgs>
|
||||
<vmArgs>-Xmx2G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer</vmArgs>
|
||||
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
|
||||
<programArgs>-clearPersistedState
|
||||
</programArgs>
|
||||
<vmArgs>-Xmx2G -Dosgi.instance.area=@user.home/.scviewer -Dosgi.instance.area.default=@user.home/.scviewer
|
||||
</vmArgs>
|
||||
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
|
||||
</vmArgsMac>
|
||||
</launcherArgs>
|
||||
|
||||
<windowImages/>
|
||||
|
||||
|
||||
<launcher name="scviewer">
|
||||
<linux icon="icons/SCViewer_512x512.xpm"/>
|
||||
<macosx icon="icons/SCViewer.icns"/>
|
||||
@ -41,103 +45,21 @@
|
||||
</license>
|
||||
|
||||
<plugins>
|
||||
<plugin id="com.google.guava"/>
|
||||
<plugin id="com.ibm.icu"/>
|
||||
<plugin id="com.minres.scviewer.database"/>
|
||||
<plugin id="com.minres.scviewer.database.sqlite"/>
|
||||
<plugin id="com.minres.scviewer.database.text"/>
|
||||
<plugin id="com.minres.scviewer.database.ui"/>
|
||||
<plugin id="com.minres.scviewer.database.ui.swt"/>
|
||||
<plugin id="com.minres.scviewer.database.vcd"/>
|
||||
<plugin id="com.minres.scviewer.e4.application"/>
|
||||
<plugin id="com.opcoach.e4.preferences"/>
|
||||
<plugin id="com.opcoach.e4.preferences.mainmenu"/>
|
||||
<plugin id="javax.annotation"/>
|
||||
<plugin id="javax.inject"/>
|
||||
<plugin id="org.apache.batik.constants"/>
|
||||
<plugin id="org.apache.batik.css"/>
|
||||
<plugin id="org.apache.batik.i18n"/>
|
||||
<plugin id="org.apache.batik.util"/>
|
||||
<plugin id="org.apache.commons.io"/>
|
||||
<plugin id="org.apache.commons.jxpath"/>
|
||||
<plugin id="org.apache.commons.logging"/>
|
||||
<plugin id="org.apache.felix.scr"/>
|
||||
<plugin id="org.apache.xmlgraphics"/>
|
||||
<plugin id="org.codehaus.groovy"/>
|
||||
<plugin id="org.eclipse.core.commands"/>
|
||||
<plugin id="org.eclipse.core.contenttype"/>
|
||||
<plugin id="org.eclipse.core.databinding"/>
|
||||
<plugin id="org.eclipse.core.databinding.beans"/>
|
||||
<plugin id="org.eclipse.core.databinding.observable"/>
|
||||
<plugin id="org.eclipse.core.databinding.property"/>
|
||||
<plugin id="org.eclipse.core.expressions"/>
|
||||
<plugin id="org.eclipse.core.filesystem"/>
|
||||
<plugin id="org.eclipse.core.filesystem.linux.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.core.filesystem.win32.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.core.jobs"/>
|
||||
<plugin id="org.eclipse.core.resources"/>
|
||||
<plugin id="org.eclipse.core.resources.win32.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.core.runtime"/>
|
||||
<plugin id="org.eclipse.e4.core.commands"/>
|
||||
<plugin id="org.eclipse.e4.core.contexts"/>
|
||||
<plugin id="org.eclipse.e4.core.di"/>
|
||||
<plugin id="org.eclipse.e4.core.di.annotations"/>
|
||||
<plugin id="org.eclipse.e4.core.di.extensions"/>
|
||||
<plugin id="org.eclipse.e4.core.di.extensions.supplier"/>
|
||||
<plugin id="org.eclipse.e4.core.services"/>
|
||||
<plugin id="org.eclipse.e4.emf.xpath"/>
|
||||
<plugin id="org.eclipse.e4.ui.bindings"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.core"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.css.swt.theme"/>
|
||||
<plugin id="org.eclipse.e4.ui.di"/>
|
||||
<plugin id="org.eclipse.e4.ui.dialogs"/>
|
||||
<plugin id="org.eclipse.e4.ui.model.workbench"/>
|
||||
<plugin id="org.eclipse.e4.ui.services"/>
|
||||
<plugin id="org.eclipse.e4.ui.swt.gtk" fragment="true"/>
|
||||
<plugin id="org.eclipse.e4.ui.widgets"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.addons.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench.swt"/>
|
||||
<plugin id="org.eclipse.e4.ui.workbench3"/>
|
||||
<plugin id="org.eclipse.emf.common"/>
|
||||
<plugin id="org.eclipse.emf.ecore"/>
|
||||
<plugin id="org.eclipse.emf.ecore.change"/>
|
||||
<plugin id="org.eclipse.emf.ecore.xmi"/>
|
||||
<plugin id="org.eclipse.equinox.app"/>
|
||||
<plugin id="org.eclipse.equinox.common"/>
|
||||
<plugin id="org.eclipse.equinox.concurrent"/>
|
||||
<plugin id="org.eclipse.equinox.event"/>
|
||||
<plugin id="org.eclipse.equinox.preferences"/>
|
||||
<plugin id="org.eclipse.equinox.region" fragment="true"/>
|
||||
<plugin id="org.eclipse.equinox.registry"/>
|
||||
<plugin id="org.eclipse.equinox.transforms.hook" fragment="true"/>
|
||||
<plugin id="org.eclipse.equinox.weaving.hook" fragment="true"/>
|
||||
<plugin id="org.eclipse.help"/>
|
||||
<plugin id="org.eclipse.jface"/>
|
||||
<plugin id="org.eclipse.jface.databinding"/>
|
||||
<plugin id="org.eclipse.osgi"/>
|
||||
<plugin id="org.eclipse.osgi.compatibility.state" fragment="true"/>
|
||||
<plugin id="org.eclipse.osgi.services"/>
|
||||
<plugin id="org.eclipse.osgi.util"/>
|
||||
<plugin id="org.eclipse.pde.ds.lib"/>
|
||||
<plugin id="org.eclipse.swt"/>
|
||||
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
|
||||
<plugin id="org.eclipse.ui.workbench"/>
|
||||
<plugin id="org.w3c.css.sac"/>
|
||||
<plugin id="org.w3c.dom.events"/>
|
||||
<plugin id="org.w3c.dom.smil"/>
|
||||
<plugin id="org.w3c.dom.svg"/>
|
||||
</plugins>
|
||||
|
||||
<features>
|
||||
<feature id="com.minres.scviewer.e4.feature" installMode="root"/>
|
||||
<feature id="com.minres.scviewer.e4.platform.feature" installMode="root"/>
|
||||
</features>
|
||||
|
||||
<configurations>
|
||||
<plugin id="com.minres.scviewer.database.text" autoStart="true" startLevel="2" />
|
||||
<plugin id="com.minres.scviewer.database.vcd" autoStart="true" startLevel="2" />
|
||||
<plugin id="org.apache.felix.scr" autoStart="true" startLevel="1" />
|
||||
<plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
|
||||
<plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
|
||||
<plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
|
||||
<plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
|
||||
<plugin id="org.eclipse.osgi" autoStart="true" startLevel="-1" />
|
||||
</configurations>
|
||||
|
||||
|
@ -8,8 +8,9 @@
|
||||
<unit id="org.eclipse.equinox.p2.sdk.feature.jar" version="0.0.0"/> <!-- needed by Linux exectable-->
|
||||
<unit id="org.eclipse.equinox.sdk.feature.group" version="0.0.0"/>
|
||||
<unit id="org.eclipse.platform.sdk" version="0.0.0"/>
|
||||
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <!-- org.junit for testing -->
|
||||
<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/> <!-- org.eclipse.equinox.p2.iu -->
|
||||
<unit id="org.eclipse.rcptt.core.feature.group" version="0.0.0"/><!-- com.google.guave-->
|
||||
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/> <!-- org.junit for testing -->
|
||||
</location>
|
||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
|
||||
<repository location="https://www.opcoach.com/repository/2020-03/"/>
|
||||
|
@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
@ -85,4 +85,11 @@ http://www.eclipse.org/legal/epl-v10.html
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.google.guava"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
@ -71,4 +71,11 @@
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.opcoach.e4.preferences"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
1
features/com.minres.scviewer.e4.platform.feature/.gitignore
vendored
Normal file
1
features/com.minres.scviewer.e4.platform.feature/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/target/
|
17
features/com.minres.scviewer.e4.platform.feature/.project
Normal file
17
features/com.minres.scviewer.e4.platform.feature/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.minres.scviewer.e4.platform.feature</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.FeatureBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.FeatureNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1 @@
|
||||
bin.includes = feature.xml
|
72
features/com.minres.scviewer.e4.platform.feature/feature.xml
Normal file
72
features/com.minres.scviewer.e4.platform.feature/feature.xml
Normal file
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="com.minres.scviewer.e4.platform.feature"
|
||||
label="SCViewer Platform Feature"
|
||||
version="1.0.0.qualifier"
|
||||
provider-name="MINRES Technologies GmbH">
|
||||
|
||||
<description url="http://www.example.com/description">
|
||||
[Enter Feature Description here.]
|
||||
</description>
|
||||
|
||||
<copyright url="http://www.example.com/copyright">
|
||||
[Enter Copyright Description here.]
|
||||
</copyright>
|
||||
|
||||
<license url="http://www.example.com/license">
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<includes
|
||||
id="org.eclipse.e4.rcp"
|
||||
version="0.0.0"/>
|
||||
|
||||
<includes
|
||||
id="org.eclipse.emf.ecore"
|
||||
version="0.0.0"/>
|
||||
|
||||
<includes
|
||||
id="org.eclipse.emf.common"
|
||||
version="0.0.0"/>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.eclipse.core.expressions" version="3.2.0" match="compatible"/>
|
||||
<import plugin="org.eclipse.core.filesystem" version="1.3.0" match="compatible"/>
|
||||
<import plugin="org.eclipse.core.runtime" version="3.12.0" match="compatible"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.core.resources"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.core.filesystem"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.core.filesystem.linux.x86_64"
|
||||
os="linux"
|
||||
arch="x86_64"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
fragment="true"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.eclipse.core.filesystem.win32.x86_64"
|
||||
os="win32"
|
||||
arch="x86_64"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
fragment="true"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
12
features/com.minres.scviewer.e4.platform.feature/pom.xml
Normal file
12
features/com.minres.scviewer.e4.platform.feature/pom.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<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.platform.feature</artifactId>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</project>
|
@ -6,9 +6,9 @@
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
A viewer for SystemC Verification Library transactions and VCD
|
||||
signals. It supports a SQLite based recording as well as the built-in
|
||||
text base recording.
|
||||
A viewer for SystemC Verification Library transactions and VCD
|
||||
signals. It supports a SQLite based recording as well as the
|
||||
built-in text base recording.
|
||||
</description>
|
||||
|
||||
<copyright>
|
||||
|
@ -17,4 +17,18 @@
|
||||
[Enter License Description here.]
|
||||
</license>
|
||||
|
||||
<plugin
|
||||
id="com.minres.scviewer.database.ui"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.minres.scviewer.database.ui.swt"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
</feature>
|
||||
|
@ -3,12 +3,13 @@
|
||||
<feature url="features/com.minres.scviewer.feature_1.0.0.qualifier.jar" id="com.minres.scviewer.feature" version="1.0.0.qualifier">
|
||||
<category name="com.minres.scviewer"/>
|
||||
</feature>
|
||||
<feature url="features/com.minres.scviewer.feature.source_1.0.0.qualifier.jar" id="com.minres.scviewer.feature.source" version="1.0.0.qualifier">
|
||||
<category name="com.minres.scviewer"/>
|
||||
<feature id="com.minres.scviewer.e4.feature">
|
||||
<category name="com.minres.scviewer.e4"/>
|
||||
</feature>
|
||||
<category-def name="com.minres.scviewer" label="SCViewer">
|
||||
<description>
|
||||
Viewer for SystemC Verification (SCV) library's transaction recording
|
||||
</description>
|
||||
</category-def>
|
||||
<category-def name="com.minres.scviewer.e4" label="SCViewer E4 application"/>
|
||||
</site>
|
||||
|
@ -70,7 +70,7 @@ public class TextDbLoader implements IWaveformDbLoader{
|
||||
try {
|
||||
def gzipped = isGzipped(file)
|
||||
if(isTxfile(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))){
|
||||
def mapDbFile = File.createTempFile("."+file.name, "tmp", file.parentFile)
|
||||
def mapDbFile = File.createTempFile("."+file.name, null /*"tmp"*/, null /*file.parentFile*/)
|
||||
mapDbFile.delete()
|
||||
mapDbFile.deleteOnExit()
|
||||
this.mapDb = DBMaker
|
||||
|
@ -16,7 +16,6 @@ import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Path;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
@ -89,9 +88,8 @@ public class ArrowPainter implements IPainter {
|
||||
deferredUpdate = true;
|
||||
return;
|
||||
}
|
||||
selectionOffset = waveCanvas.getXOffset();
|
||||
int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
|
||||
txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor-waveCanvas.getXOffset()),
|
||||
txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor),
|
||||
waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * tx.getConcurrencyIndex(),
|
||||
(int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight);
|
||||
deriveGeom(tx.getIncomingRelations(), iRect, false);
|
||||
@ -105,7 +103,7 @@ public class ArrowPainter implements IPainter {
|
||||
ITxStream<?> stream = otherTx.getStream();
|
||||
IWaveformPainter painter = waveCanvas.wave2painterMap.get(stream);
|
||||
int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
|
||||
Rectangle bb = new Rectangle((int) (otherTx.getBeginTime() / scaleFactor-waveCanvas.getXOffset()),
|
||||
Rectangle bb = new Rectangle((int) (otherTx.getBeginTime() / scaleFactor),
|
||||
waveCanvas.rulerHeight + painter.getVerticalOffset()
|
||||
+ laneHeight * otherTx.getConcurrencyIndex(),
|
||||
(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), laneHeight);
|
||||
@ -115,7 +113,7 @@ public class ArrowPainter implements IPainter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
public void paintArea(Projection proj, Rectangle clientRect) {
|
||||
Color fgColor = waveCanvas.colors[WaveformColors.REL_ARROW.ordinal()];
|
||||
Color highliteColor = waveCanvas.colors[WaveformColors.REL_ARROW_HIGHLITE.ordinal()];
|
||||
|
||||
@ -124,33 +122,30 @@ public class ArrowPainter implements IPainter {
|
||||
calculateGeometries();
|
||||
}
|
||||
if(txRectangle == null) return;
|
||||
int correctionValue = (int)(selectionOffset - waveCanvas.getXOffset());
|
||||
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(gc, highlightType.equals(entry.relationType) ? highliteColor : fgColor,
|
||||
Point target = drawPath(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor,
|
||||
correctedRectangle, correctedTargetRectangle);
|
||||
drawArrow(gc, target);
|
||||
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(gc, highlightType.equals(entry.relationType) ? highliteColor : fgColor, correctedTargetRectangle,
|
||||
Point target = drawPath(proj, highlightType.equals(entry.relationType) ? highliteColor : fgColor, correctedTargetRectangle,
|
||||
correctedRectangle);
|
||||
drawArrow(gc, target);
|
||||
drawArrow(proj, target);
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawArrow(GC gc, Point target) {
|
||||
gc.drawLine(target.x - 8, target.y - 5, target.x, target.y);
|
||||
gc.drawLine(target.x - 8, target.y + 5, target.x, target.y);
|
||||
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(GC gc, Color fgColor, Rectangle srcRectangle, Rectangle tgtRectangle) {
|
||||
Point point1 = new Point(0, srcRectangle.y + srcRectangle.height / 2);
|
||||
Point point2 = new Point(0, tgtRectangle.y + tgtRectangle.height / 2);
|
||||
|
||||
point1.x = srcRectangle.x;
|
||||
point2.x = tgtRectangle.x;
|
||||
protected Point drawPath(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));
|
||||
|
||||
if (point2.x > point1.x + srcRectangle.width)
|
||||
point1.x += srcRectangle.width;
|
||||
@ -165,9 +160,9 @@ 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);
|
||||
gc.setAntialias(SWT.ON);
|
||||
gc.setForeground(fgColor);
|
||||
gc.drawPath(path);
|
||||
proj.setAntialias(SWT.ON);
|
||||
proj.setForeground(fgColor);
|
||||
proj.getGC().drawPath(path);
|
||||
path.dispose();
|
||||
return point2;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.minres.scviewer.database.ui.ICursor;
|
||||
@ -62,30 +61,30 @@ public class CursorPainter implements IPainter, ICursor {
|
||||
}
|
||||
|
||||
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
public void paintArea(Projection proj, Rectangle clientRect) {
|
||||
Rectangle area = proj.unProject(clientRect);
|
||||
if(this.waveCanvas.painterList.size()>0){
|
||||
|
||||
long scaleFactor=waveCanvas.getScaleFactor();
|
||||
long beginPos = area.x;
|
||||
|
||||
maxPosX = area.x + area.width;
|
||||
maxValX = maxPosX + (int)waveCanvas.getXOffset();
|
||||
maxValX = maxPosX;
|
||||
|
||||
// x position of marker in pixels on canvas
|
||||
int x = (int) (time/scaleFactor);
|
||||
// distance of marker from the top of Canvas' painting area
|
||||
int top = id<0?area.y:area.y+15;
|
||||
|
||||
Color drawColor=waveCanvas.colors[id<0?WaveformColors.CURSOR.ordinal():WaveformColors.MARKER.ordinal()];
|
||||
Color dragColor = waveCanvas.colors[WaveformColors.CURSOR_DRAG.ordinal()];
|
||||
Color textColor=waveCanvas.colors[id<0?WaveformColors.CURSOR_TEXT.ordinal():WaveformColors.MARKER_TEXT.ordinal()];
|
||||
if(x>=beginPos && x<=maxValX){
|
||||
gc.setForeground(isDragging?dragColor:drawColor);
|
||||
gc.drawLine(x-(int)waveCanvas.getXOffset(), top, x-(int)waveCanvas.getXOffset(), area.y+area.height);
|
||||
gc.setBackground(drawColor);
|
||||
gc.setForeground(textColor);
|
||||
proj.setForeground(isDragging?dragColor:drawColor);
|
||||
proj.drawLine(x, top, x, area.y+area.height);
|
||||
proj.setBackground(drawColor);
|
||||
proj.setForeground(textColor);
|
||||
Double dTime=new Double(time);
|
||||
gc.drawText((dTime/waveCanvas.getScaleFactorPow10())+waveCanvas.getUnitStr(), x+1-(int)waveCanvas.getXOffset(), top);
|
||||
proj.drawText((dTime/waveCanvas.getScaleFactorPow10())+waveCanvas.getUnitStr(), x+1, top);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,11 +10,10 @@
|
||||
*******************************************************************************/
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
public interface IPainter {
|
||||
|
||||
void paintArea(GC gc,Rectangle area);
|
||||
void paintArea(Projection gc, Rectangle area);
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.minres.scviewer.database.swt.internal;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
public class Projection {
|
||||
|
||||
private Point translation;
|
||||
private GC gc;
|
||||
|
||||
public Projection(GC gc) {
|
||||
super();
|
||||
this.gc = gc;
|
||||
translation=new Point(0, 0);
|
||||
}
|
||||
|
||||
void setTranslation(Point t) {
|
||||
translation = t;
|
||||
}
|
||||
|
||||
void setGC(GC gc) {
|
||||
this.gc=gc;
|
||||
}
|
||||
|
||||
Point getTranslation() {
|
||||
return translation;
|
||||
}
|
||||
|
||||
Point project(Point p) {
|
||||
return new Point(p.x+translation.x, p.y+translation.y);
|
||||
}
|
||||
|
||||
public Rectangle unProject(Rectangle r) {
|
||||
return new Rectangle(r.x-translation.x, r.y-translation.y, r.width, r.height);
|
||||
}
|
||||
|
||||
public void setBackground(Color color) {
|
||||
gc.setBackground(color);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
public void setLineWidth(int width) {
|
||||
gc.setLineWidth(width);
|
||||
}
|
||||
|
||||
public void setForeground(Color color) {
|
||||
gc.setForeground(color);
|
||||
}
|
||||
|
||||
public void drawLine(int x1, int y1, int x2, int y2) {
|
||||
gc.drawLine(x1+translation.x, y1+translation.y, x2+translation.x, y2+translation.y);
|
||||
|
||||
}
|
||||
|
||||
public GC getGC() {
|
||||
return gc;
|
||||
}
|
||||
|
||||
public void drawRectangle(Rectangle rect) {
|
||||
gc.drawRectangle(rect.x+translation.y, rect.y+translation.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
public void fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
|
||||
gc.fillRoundRectangle(x+translation.x, y+translation.y, width, height, arcWidth, arcHeight);
|
||||
}
|
||||
|
||||
public void drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) {
|
||||
gc.drawRoundRectangle(x+translation.x, y+translation.y, width, height, arcWidth, arcHeight);
|
||||
}
|
||||
|
||||
public void setAntialias(int antialias) {
|
||||
gc.setAntialias(antialias);
|
||||
}
|
||||
|
||||
public void drawText(String string, int x, int y) {
|
||||
gc.drawText(string, x+translation.x, y+translation.y);
|
||||
}
|
||||
|
||||
private int[] project(int[] points) {
|
||||
int[] res = Arrays.copyOf(points, points.length);
|
||||
for(int i=0; i<points.length; i+=2) {
|
||||
res[i]=points[i]+translation.x;
|
||||
res[i+1]=points[i+1]+translation.y;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public void fillPolygon(int[] points) {
|
||||
gc.fillPolygon(project(points));
|
||||
}
|
||||
|
||||
public void drawPolygon(int[] points) {
|
||||
gc.drawPolygon(project(points));
|
||||
}
|
||||
|
||||
public Rectangle getClipping() {
|
||||
Rectangle c = gc.getClipping();
|
||||
return new Rectangle(c.x-translation.x, c.y-translation.y, c.width, c.height);
|
||||
}
|
||||
|
||||
public void setClipping(int x, int y, int width, int height) {
|
||||
gc.setClipping(x+translation.x, y+translation.y, width, height);
|
||||
}
|
||||
|
||||
public void setClipping(Rectangle r) {
|
||||
gc.setClipping(r.x+translation.x, r.y+translation.y, r.width, r.height);
|
||||
}
|
||||
|
||||
}
|
@ -31,8 +31,8 @@ public class RulerPainter implements IPainter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
|
||||
public void paintArea(Projection proj, Rectangle area) {
|
||||
GC gc = proj.getGC();
|
||||
Color headerFgColor=waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
|
||||
if(headerFgColor.isDisposed())
|
||||
headerFgColor=SWTResourceManager.getColor(0,0,0);
|
||||
@ -44,7 +44,7 @@ public class RulerPainter implements IPainter {
|
||||
long scaleFactor=waveCanvas.getScaleFactor();
|
||||
|
||||
long startPos=area.x*scaleFactor;
|
||||
long startVal=startPos + waveCanvas.getXOffset()*scaleFactor;
|
||||
long startVal=startPos - proj.getTranslation().x*scaleFactor;
|
||||
long endPos=startPos+area.width*scaleFactor;
|
||||
|
||||
long rulerTickMinor = rulerTickMinorC*scaleFactor;
|
||||
|
@ -79,22 +79,22 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
|
||||
private int getXPosEnd(long time) {
|
||||
long ltmp = time / this.waveCanvas.getScaleFactor() - waveCanvas.getXOffset();
|
||||
long ltmp = time / this.waveCanvas.getScaleFactor();
|
||||
return ltmp > maxPosX ? maxPosX : (int) ltmp;
|
||||
}
|
||||
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
public void paintArea(Projection proj, Rectangle area) {
|
||||
ISignal<?> signal = trackEntry.getSignal();
|
||||
if (trackEntry.selected)
|
||||
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
proj.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
else
|
||||
gc.setBackground(this.waveCanvas.colors[even ? WaveformColors.TRACK_BG_EVEN.ordinal() : WaveformColors.TRACK_BG_ODD.ordinal()]);
|
||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
gc.fillRectangle(area);
|
||||
proj.setBackground(this.waveCanvas.colors[even ? WaveformColors.TRACK_BG_EVEN.ordinal() : WaveformColors.TRACK_BG_ODD.ordinal()]);
|
||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
proj.fillRectangle(area);
|
||||
|
||||
long scaleFactor = this.waveCanvas.getScaleFactor();
|
||||
long beginPos = area.x;
|
||||
long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
|
||||
long beginTime = beginPos*scaleFactor;
|
||||
long endTime = beginTime + area.width*scaleFactor;
|
||||
|
||||
Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
|
||||
@ -106,18 +106,17 @@ public class SignalPainter extends TrackPainter {
|
||||
} else if (last == null) {
|
||||
last = signal.getEvents().lastEntry();
|
||||
}
|
||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
gc.setLineStyle(SWT.LINE_SOLID);
|
||||
gc.setLineWidth(1);
|
||||
proj.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
proj.setLineStyle(SWT.LINE_SOLID);
|
||||
proj.setLineWidth(1);
|
||||
NavigableMap<Long, ?> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true);
|
||||
SignalChange left = new SignalChange(first);
|
||||
SignalChange right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first);
|
||||
maxPosX = area.x + area.width;
|
||||
maxValX = maxPosX + (int)waveCanvas.getXOffset();
|
||||
yOffsetT = this.waveCanvas.getTrackHeight() / 5 + area.y;
|
||||
yOffsetM = this.waveCanvas.getTrackHeight() / 2 + area.y;
|
||||
yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
|
||||
int xSigChangeBeginVal = Math.max(area.x + (int)waveCanvas.getXOffset(), (int) (left.time / this.waveCanvas.getScaleFactor()));
|
||||
int xSigChangeBeginVal = Math.max(area.x, (int) (left.time / this.waveCanvas.getScaleFactor()));
|
||||
int xSigChangeBeginPos = area.x;
|
||||
int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
|
||||
|
||||
@ -138,9 +137,9 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
|
||||
|
||||
SignalStencil stencil = getStencil(gc, left, entries);
|
||||
SignalStencil stencil = getStencil(proj.getGC(), left, entries);
|
||||
do {
|
||||
stencil.draw(gc, area, left.value, right.value, xSigChangeBeginPos, xSigChangeEndPos, multiple);
|
||||
stencil.draw(proj, area, left.value, right.value, xSigChangeBeginPos, xSigChangeEndPos, multiple);
|
||||
if (right.time >= endTime)
|
||||
break;
|
||||
left.assign(right);
|
||||
@ -179,7 +178,7 @@ public class SignalPainter extends TrackPainter {
|
||||
|
||||
private interface SignalStencil {
|
||||
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple);
|
||||
public void draw(Projection proj, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple);
|
||||
}
|
||||
|
||||
private class MultiBitStencil implements SignalStencil {
|
||||
@ -193,7 +192,7 @@ public class SignalPainter extends TrackPainter {
|
||||
tmpAwtFont = new java.awt.Font(fd.getName(), fd.getStyle(), height);
|
||||
}
|
||||
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
public void draw(Projection proj, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
Color colorBorder = waveCanvas.colors[WaveformColors.SIGNAL0.ordinal()];
|
||||
BitVector last = (BitVector) left;
|
||||
if (last.getValue().toString().contains("X")) {
|
||||
@ -211,9 +210,9 @@ public class SignalPainter extends TrackPainter {
|
||||
xEnd - 1, yOffsetB,
|
||||
xBegin + 1, yOffsetB
|
||||
};
|
||||
gc.setForeground(colorBorder);
|
||||
gc.drawPolygon(points);
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_TEXT.ordinal()]);
|
||||
proj.setForeground(colorBorder);
|
||||
proj.drawPolygon(points);
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_TEXT.ordinal()]);
|
||||
//TODO: this code should be provided from a central location
|
||||
String label = null;
|
||||
switch(trackEntry.valueDisplay) {
|
||||
@ -226,27 +225,23 @@ public class SignalPainter extends TrackPainter {
|
||||
default:
|
||||
label="h'"+last.toHexString();
|
||||
}
|
||||
Point bb = getBoxWidth(gc, label);
|
||||
Point bb = new Point(DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(label), height);
|
||||
if (xBegin < area.x) {
|
||||
xBegin = area.x;
|
||||
width = xEnd - xBegin;
|
||||
}
|
||||
if (width > (bb.x+1)) {
|
||||
Rectangle old = gc.getClipping();
|
||||
gc.setClipping(xBegin + 3, yOffsetT, xEnd - xBegin - 5, yOffsetB - yOffsetT);
|
||||
gc.drawText(label, xBegin + 3, yOffsetM - bb.y / 2 - 1);
|
||||
gc.setClipping(old);
|
||||
Rectangle old = proj.getClipping();
|
||||
proj.setClipping(xBegin + 3, yOffsetT, xEnd - xBegin - 5, yOffsetB - yOffsetT);
|
||||
proj.drawText(label, xBegin + 3, yOffsetM - bb.y / 2 - 1);
|
||||
proj.setClipping(old);
|
||||
}
|
||||
} else {
|
||||
gc.setForeground(colorBorder);
|
||||
gc.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
proj.setForeground(colorBorder);
|
||||
proj.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
}
|
||||
}
|
||||
|
||||
private Point getBoxWidth(GC gc, String label) {
|
||||
return new Point(DUMMY_PANEL.getFontMetrics(tmpAwtFont).stringWidth(label), height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class MultiBitStencilAnalog implements SignalStencil {
|
||||
@ -277,25 +272,25 @@ public class SignalPainter extends TrackPainter {
|
||||
|
||||
}
|
||||
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
public void draw(Projection proj, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
long leftVal = ((BitVector) left).toUnsignedValue();
|
||||
long rightVal= ((BitVector) right).toUnsignedValue();
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
}
|
||||
} else {
|
||||
if (xEnd > maxPosX) {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
|
||||
if(yOffsetRight!=yOffsetLeft) {
|
||||
gc.drawLine(xEnd, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xEnd, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -303,12 +298,12 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
|
||||
private class SingleBitStencil implements SignalStencil {
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
public void draw(Projection proj, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
if (multiple) {
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNALU.ordinal()]);
|
||||
gc.drawLine(xBegin, yOffsetT, xBegin, yOffsetB);
|
||||
proj.setForeground(waveCanvas.colors[WaveformColors.SIGNALU.ordinal()]);
|
||||
proj.drawLine(xBegin, yOffsetT, xBegin, yOffsetB);
|
||||
if(xEnd>xBegin)
|
||||
gc.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
proj.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
} else {
|
||||
Color color = waveCanvas.colors[WaveformColors.SIGNALX.ordinal()];
|
||||
int yOffset = yOffsetM;
|
||||
@ -326,11 +321,11 @@ public class SignalPainter extends TrackPainter {
|
||||
break;
|
||||
default:
|
||||
}
|
||||
gc.setForeground(color);
|
||||
proj.setForeground(color);
|
||||
if (xEnd > maxPosX) {
|
||||
gc.drawLine(xBegin, yOffset, maxPosX, yOffset);
|
||||
proj.drawLine(xBegin, yOffset, maxPosX, yOffset);
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffset, xEnd, yOffset);
|
||||
proj.drawLine(xBegin, yOffset, xEnd, yOffset);
|
||||
int yNext = yOffsetM;
|
||||
switch (((BitVector) right).getValue()[0]) {
|
||||
case '1':
|
||||
@ -342,7 +337,7 @@ public class SignalPainter extends TrackPainter {
|
||||
default:
|
||||
}
|
||||
if (yOffset != yNext)
|
||||
gc.drawLine(xEnd, yOffset, xEnd, yNext);
|
||||
proj.drawLine(xEnd, yOffset, xEnd, yNext);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -383,7 +378,7 @@ public class SignalPainter extends TrackPainter {
|
||||
}
|
||||
}
|
||||
|
||||
public void draw(GC gc, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
public void draw(Projection proj, Rectangle area, Object left, Object right, int xBegin, int xEnd, boolean multiple) {
|
||||
double leftVal = (Double) left;
|
||||
double rightVal= (Double) right;
|
||||
if(Double.isNaN(leftVal)) {
|
||||
@ -396,31 +391,31 @@ public class SignalPainter extends TrackPainter {
|
||||
xEnd, yOffsetB,
|
||||
xBegin, yOffsetB
|
||||
};
|
||||
gc.setForeground(color);
|
||||
gc.drawPolygon(points);
|
||||
gc.setBackground(color);
|
||||
gc.fillPolygon(points);
|
||||
proj.setForeground(color);
|
||||
proj.drawPolygon(points);
|
||||
proj.setBackground(color);
|
||||
proj.fillPolygon(points);
|
||||
} else {
|
||||
gc.setForeground(color);
|
||||
gc.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
proj.setForeground(color);
|
||||
proj.drawLine(xEnd, yOffsetT, xEnd, yOffsetB);
|
||||
}
|
||||
} else {
|
||||
gc.setForeground(waveCanvas.colors[WaveformColors.SIGNAL_REAL.ordinal()]);
|
||||
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));
|
||||
if(continous) {
|
||||
if (xEnd > maxPosX) {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
}
|
||||
} else {
|
||||
if (xEnd > maxPosX) {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
|
||||
} else {
|
||||
gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
|
||||
proj.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
|
||||
if(yOffsetRight!=yOffsetLeft) {
|
||||
gc.drawLine(xEnd, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
proj.drawLine(xEnd, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,22 +60,22 @@ public class StreamPainter extends TrackPainter{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void paintArea(GC gc, Rectangle area) {
|
||||
public void paintArea(Projection proj, Rectangle area) {
|
||||
if(stream.getEvents().size()==0) return;
|
||||
int trackHeight=trackEntry.height/stream.getMaxConcurrency();
|
||||
txBase=trackHeight/5;
|
||||
txHeight=trackHeight*3/5;
|
||||
if(trackEntry.selected) {
|
||||
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
proj.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
|
||||
}
|
||||
else
|
||||
gc.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]);
|
||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
gc.fillRectangle(area);
|
||||
proj.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]);
|
||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
proj.fillRectangle(area);
|
||||
|
||||
long scaleFactor = this.waveCanvas.getScaleFactor();
|
||||
long beginPos = area.x;
|
||||
long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
|
||||
long beginTime = beginPos*scaleFactor;
|
||||
//long endPos = beginPos + area.width;
|
||||
long endTime = beginTime + area.width*scaleFactor;
|
||||
|
||||
@ -83,21 +83,21 @@ public class StreamPainter extends TrackPainter{
|
||||
Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry(endTime);
|
||||
if(firstTx==null) firstTx = stream.getEvents().firstEntry();
|
||||
if(lastTx==null) lastTx=stream.getEvents().lastEntry();
|
||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
gc.setLineStyle(SWT.LINE_SOLID);
|
||||
gc.setLineWidth(1);
|
||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
proj.setLineStyle(SWT.LINE_SOLID);
|
||||
proj.setLineWidth(1);
|
||||
proj.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
|
||||
for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
|
||||
gc.drawLine(area.x, y1, area.x+area.width, y1);
|
||||
proj.drawLine(area.x, y1, area.x+area.width, y1);
|
||||
if(firstTx==lastTx) {
|
||||
for(ITxEvent txEvent:(Collection<? extends ITxEvent>)firstTx.getValue())
|
||||
drawTx(gc, area, txEvent.getTransaction(), false);
|
||||
drawTx(proj, area, txEvent.getTransaction(), false);
|
||||
}else{
|
||||
seenTx.clear();
|
||||
NavigableMap<Long,?> entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true);
|
||||
boolean highlighed=false;
|
||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
proj.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
|
||||
|
||||
for(Entry<Long, ?> entry: entries.entrySet())
|
||||
for(ITxEvent txEvent:(Collection<? extends ITxEvent>)entry.getValue()){
|
||||
@ -106,38 +106,38 @@ public class StreamPainter extends TrackPainter{
|
||||
if(txEvent.getType()==ITxEvent.Type.END){
|
||||
ITx tx = txEvent.getTransaction();
|
||||
highlighed|=waveCanvas.currentSelection!=null && waveCanvas.currentSelection.equals(tx);
|
||||
drawTx(gc, area, tx, false);
|
||||
drawTx(proj, area, tx, false);
|
||||
seenTx.remove(tx);
|
||||
}
|
||||
}
|
||||
for(ITx tx:seenTx){
|
||||
drawTx(gc, area, tx, false);
|
||||
drawTx(proj, area, tx, false);
|
||||
}
|
||||
if(highlighed){
|
||||
gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE_HIGHLITE.ordinal()]);
|
||||
drawTx(gc, area, waveCanvas.currentSelection, true);
|
||||
proj.setForeground(this.waveCanvas.colors[WaveformColors.LINE_HIGHLITE.ordinal()]);
|
||||
drawTx(proj, area, waveCanvas.currentSelection, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawTx(GC gc, Rectangle area, ITx tx, boolean highlighted ) {
|
||||
protected void drawTx(Projection proj, Rectangle area, ITx tx, boolean highlighted ) {
|
||||
// compute colors
|
||||
java.awt.Color[] fallbackColors = trackEntry.getColors();
|
||||
java.awt.Color[] transColor = TrackEntry.computeColor( tx.getGenerator().getName(), fallbackColors[0], fallbackColors[1] );
|
||||
|
||||
gc.setBackground( toSwtColor( gc, transColor[highlighted?1:0] ) );
|
||||
proj.setBackground( toSwtColor( proj.getGC(), transColor[highlighted?1:0] ) );
|
||||
|
||||
int offset = tx.getConcurrencyIndex()*this.waveCanvas.getTrackHeight();
|
||||
Rectangle bb = new Rectangle(
|
||||
(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()-waveCanvas.getXOffset()), area.y+offset+txBase,
|
||||
(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()), area.y+offset+txBase,
|
||||
(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScaleFactor()), txHeight);
|
||||
|
||||
if(bb.x+bb.width<area.x || bb.x>area.x+area.width) return;
|
||||
if(bb.width==0){
|
||||
gc.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height);
|
||||
proj.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height);
|
||||
} else if(bb.width<10){
|
||||
gc.fillRectangle(bb);
|
||||
gc.drawRectangle(bb);
|
||||
proj.fillRectangle(bb);
|
||||
proj.drawRectangle(bb);
|
||||
} else {
|
||||
if(bb.x < area.x) {
|
||||
bb.width = bb.width-(area.x-bb.x)+5;
|
||||
@ -149,8 +149,8 @@ public class StreamPainter extends TrackPainter{
|
||||
bb_x2=area_x2+5;
|
||||
bb.width= bb_x2-bb.x;
|
||||
}
|
||||
gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
proj.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
proj.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import java.util.Map.Entry;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
@ -35,11 +34,11 @@ public class TrackAreaPainter implements IPainter {
|
||||
this.trackVerticalOffset= new TreeMap<>();
|
||||
}
|
||||
|
||||
public void paintArea(GC gc, Rectangle a) {
|
||||
Rectangle area = new Rectangle(a.x, a.y+waveCanvas.rulerHeight, a.width, a.height-waveCanvas.rulerHeight);
|
||||
gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_EVEN.ordinal()]);
|
||||
gc.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
gc.fillRectangle(area);
|
||||
public void paintArea(Projection proj, Rectangle a) {
|
||||
Rectangle area = proj.unProject(new Rectangle(a.x, a.y+waveCanvas.rulerHeight, a.width, a.height-waveCanvas.rulerHeight));
|
||||
proj.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_EVEN.ordinal()]);
|
||||
proj.setFillRule(SWT.FILL_EVEN_ODD);
|
||||
proj.fillRectangle(area);
|
||||
if(trackVerticalOffset.size()>0){
|
||||
Integer firstKey=trackVerticalOffset.floorKey(area.y);
|
||||
if(firstKey==null) firstKey=trackVerticalOffset.firstKey();
|
||||
@ -49,12 +48,12 @@ public class TrackAreaPainter implements IPainter {
|
||||
subArea.y=firstKey;
|
||||
IWaveformPainter p = trackVerticalOffset.get(firstKey);
|
||||
subArea.height=p.getHeight();
|
||||
p.paintArea(gc, subArea);
|
||||
p.paintArea(proj, subArea);
|
||||
}else{
|
||||
for(Entry<Integer, IWaveformPainter> entry : trackVerticalOffset.subMap(firstKey, true, lastKey, true).entrySet()){
|
||||
subArea.y=entry.getKey();
|
||||
subArea.height=entry.getValue().getHeight();
|
||||
entry.getValue().paintArea(gc, subArea);
|
||||
entry.getValue().paintArea(proj, subArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.graphics.Transform;
|
||||
import org.eclipse.swt.widgets.Canvas;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
@ -45,7 +44,7 @@ import com.minres.scviewer.database.ui.IWaveformViewer;
|
||||
import com.minres.scviewer.database.ui.TrackEntry;
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
|
||||
public class WaveformCanvas extends Canvas{
|
||||
public class WaveformCanvas extends Canvas {
|
||||
|
||||
Color[] colors = new Color[WaveformColors.values().length];
|
||||
|
||||
@ -60,9 +59,7 @@ public class WaveformCanvas extends Canvas{
|
||||
private long maxTime;
|
||||
|
||||
protected Point origin; /* original size */
|
||||
|
||||
protected Transform transform;
|
||||
|
||||
|
||||
protected int rulerHeight=40;
|
||||
|
||||
protected List<IPainter> painterList;
|
||||
@ -89,7 +86,7 @@ public class WaveformCanvas extends Canvas{
|
||||
* the style of this control.
|
||||
*/
|
||||
public WaveformCanvas(final Composite parent, int style) {
|
||||
super(parent, style | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
super(parent, style | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND | SWT.V_SCROLL | SWT.H_SCROLL);
|
||||
addControlListener(new ControlAdapter() { /* resize listener. */
|
||||
public void controlResized(ControlEvent event) {
|
||||
syncScrollBars();
|
||||
@ -102,7 +99,6 @@ public class WaveformCanvas extends Canvas{
|
||||
});
|
||||
painterList = new LinkedList<IPainter>();
|
||||
origin = new Point(0, 0);
|
||||
transform = new Transform(getDisplay());
|
||||
selectionListeners = new LinkedList<>();
|
||||
cursorPainters= new ArrayList<>();
|
||||
wave2painterMap=new HashMap<>();
|
||||
@ -150,10 +146,6 @@ public class WaveformCanvas extends Canvas{
|
||||
|
||||
}
|
||||
|
||||
public long getXOffset() {
|
||||
return -origin.x;
|
||||
}
|
||||
|
||||
public void addCursoPainter(CursorPainter cursorPainter){
|
||||
painterList.add(cursorPainter);
|
||||
cursorPainters.add(cursorPainter);
|
||||
@ -323,7 +315,6 @@ public class WaveformCanvas extends Canvas{
|
||||
* Dispose the garbage here
|
||||
*/
|
||||
public void dispose() {
|
||||
transform.dispose();
|
||||
for (WaveformColors c : WaveformColors.values())
|
||||
colors[c.ordinal()].dispose();
|
||||
super.dispose();
|
||||
@ -402,24 +393,16 @@ public class WaveformCanvas extends Canvas{
|
||||
vertical.setSelection(-origin.y);
|
||||
redraw();
|
||||
fireSelectionEvent();
|
||||
|
||||
}
|
||||
|
||||
/* Paint function */
|
||||
private void paint(GC gc) {
|
||||
Rectangle clientRect = getClientArea(); /* Canvas' painting area */
|
||||
// clientRect.x = -origin.x;
|
||||
clientRect.y = -origin.y;
|
||||
// reset the transform
|
||||
transform.identity();
|
||||
// shift the content
|
||||
// DO NOT SHIFT HORIZONTALLY, the range is WAY TOO BIG for float!!!
|
||||
transform.translate(0, origin.y);
|
||||
gc.setTransform(transform);
|
||||
gc.setClipping(clientRect);
|
||||
Projection p = new Projection(gc);
|
||||
p.setTranslation(origin);
|
||||
if (painterList.size() > 0 ) {
|
||||
for (IPainter painter : painterList)
|
||||
painter.paintArea(gc, clientRect);
|
||||
painter.paintArea(p, clientRect);
|
||||
} else {
|
||||
gc.fillRectangle(clientRect);
|
||||
initScrollBars();
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<application:Application xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:application="http://www.eclipse.org/ui/2010/UIModel/application" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmlns:ui="http://www.eclipse.org/ui/2010/UIModel/application/ui" xmi:id="_95PfsHNmEeWBq8z1Dv39LA" elementId="org.eclipse.e4.ide.application" bindingContexts="_95PfuXNmEeWBq8z1Dv39LA">
|
||||
<children xsi:type="basic:TrimmedWindow" xmi:id="_95PfsXNmEeWBq8z1Dv39LA" label="SC Viewer" bindingContexts="_95PfunNmEeWBq8z1Dv39LA" width="980" height="700">
|
||||
<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">
|
||||
@ -144,10 +144,7 @@
|
||||
<children xsi:type="menu:ToolControl" xmi:id="_YsBi8HfLEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.StatusLine" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl">
|
||||
<tags>stretch</tags>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolControl" xmi:id="_VZzJMHdHEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.HeapStatus" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.status.StatusBarControl">
|
||||
<tags>Draggable</tags>
|
||||
</children>
|
||||
<children xsi:type="menu:ToolControl" xmi:id="_y0ZS0HfzEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.ProgressBar" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.status.StatusBarControl">
|
||||
<children xsi:type="menu:ToolControl" xmi:id="_VZzJMHdHEeWwZ-9vrAR2UQ" elementId="org.eclipse.ui.HeapStatus" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.internal.status.WaveStatusBarControl">
|
||||
<tags>Draggable</tags>
|
||||
</children>
|
||||
</trimBars>
|
||||
|
@ -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.0.qualifier
|
||||
Bundle-Version: 2.6.1.qualifier
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.core.runtime;bundle-version="3.11.1",
|
||||
@ -26,12 +26,10 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
|
||||
org.eclipse.equinox.preferences,
|
||||
org.eclipse.core.expressions,
|
||||
org.eclipse.e4.core.commands;bundle-version="0.11.0",
|
||||
org.eclipse.e4.ui.workbench.addons.swt,
|
||||
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",
|
||||
com.opcoach.e4.preferences.mainmenu;bundle-version="1.2.0"
|
||||
org.eclipse.core.resources;bundle-version="3.13.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Import-Package: com.minres.scviewer.database,
|
||||
javax.inject;version="1.0.0"
|
||||
|
@ -84,12 +84,5 @@
|
||||
category="com.minres.scviewer.e4.application.preferences.scviewer">
|
||||
</page>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.opcoach.e4.preferences.e4PreferenceStoreProvider">
|
||||
<preferenceStoreProvider
|
||||
class="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.preferences.PreferencesStoreProvider"
|
||||
pluginId="com.minres.scviewer.e4.application">
|
||||
</preferenceStoreProvider>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
@ -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.0-SNAPSHOT</version>
|
||||
<version>2.6.1-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>com.minres.scviewer</groupId>
|
||||
<artifactId>com.minres.scviewer.parent</artifactId>
|
||||
|
@ -4,45 +4,43 @@ package com.minres.scviewer.e4.application.handlers;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.eclipse.e4.core.contexts.Active;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.di.extensions.Preference;
|
||||
import org.eclipse.e4.ui.model.application.MApplication;
|
||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
|
||||
import org.eclipse.e4.ui.model.application.ui.menu.MHandledItem;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.osgi.service.prefs.BackingStoreException;
|
||||
|
||||
import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
|
||||
import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class EnableHover {
|
||||
static final String TAG_NAME = "EnableHover"; //$NON-NLS-1$
|
||||
|
||||
@Inject
|
||||
MApplication application;
|
||||
|
||||
@PostConstruct
|
||||
public void initialize(EModelService modelService) {
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnShowHoverChange(EModelService modelService, @Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
List<String> tags = new LinkedList<>();
|
||||
tags.add(TAG_NAME);
|
||||
List<MHandledItem> elements = modelService.findElements(application, null, MHandledItem.class, tags );
|
||||
// cover initialization stuff, sync it with code
|
||||
IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, PreferenceConstants.PREFERENCES_SCOPE);
|
||||
boolean state = store.getBoolean(PreferenceConstants.SHOW_HOVER);
|
||||
for( MHandledItem hi : elements ){
|
||||
hi.setSelected(state);
|
||||
hi.setSelected(hover);
|
||||
}
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(@Active MPart part, @Active MWindow window, MHandledItem handledItem, EModelService modelService ) {
|
||||
IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, PreferenceConstants.PREFERENCES_SCOPE);
|
||||
store.setValue(PreferenceConstants.SHOW_HOVER, handledItem.isSelected());
|
||||
public void execute(MHandledItem handledItem, @Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs ) {
|
||||
try {
|
||||
prefs.putBoolean(PreferenceConstants.SHOW_HOVER, handledItem.isSelected());
|
||||
prefs.flush();
|
||||
} catch (BackingStoreException e) {}
|
||||
}
|
||||
|
||||
}
|
@ -26,14 +26,10 @@ import org.eclipse.e4.ui.di.UISynchronize;
|
||||
import org.eclipse.e4.ui.model.application.ui.menu.MToolControl;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
||||
import org.eclipse.jface.action.StatusLineManager;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.ProgressBar;
|
||||
import org.osgi.service.prefs.PreferencesService;
|
||||
|
||||
import com.minres.scviewer.e4.application.AppModelId;
|
||||
import com.minres.scviewer.e4.application.Messages;
|
||||
|
||||
/**
|
||||
* The Class StatusBarControl.
|
||||
@ -58,9 +54,6 @@ public class StatusBarControl {
|
||||
/** The monitor. */
|
||||
private SyncedProgressMonitor monitor;
|
||||
|
||||
/** The progress bar. */
|
||||
private ProgressBar progressBar;
|
||||
|
||||
/**
|
||||
* Instantiates a new status bar control.
|
||||
*
|
||||
@ -84,9 +77,7 @@ public class StatusBarControl {
|
||||
if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_STATUSLINE)) { //$NON-NLS-1$
|
||||
createStatusLine(parent, toolControl);
|
||||
} else if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_HEAPSTATUS)) { //$NON-NLS-1$
|
||||
createHeapStatus(parent, toolControl);
|
||||
} else if (toolControl.getElementId().equals(AppModelId.TOOLCONTROL_ORG_ECLIPSE_UI_PROGRESSBAR)) { //$NON-NLS-1$
|
||||
createProgressBar(parent, toolControl);
|
||||
new HeapStatus(parent, osgiPreverences.getSystemPreferences());
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,36 +92,6 @@ public class StatusBarControl {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the progress bar.
|
||||
*
|
||||
* @param parent the parent
|
||||
* @param toolControl the tool control
|
||||
*/
|
||||
private void createProgressBar(Composite parent, MToolControl toolControl) {
|
||||
new Label(parent, SWT.NONE);
|
||||
progressBar = new ProgressBar(parent, SWT.SMOOTH);
|
||||
progressBar.setBounds(100, 10, 200, 20);
|
||||
new Label(parent, SWT.NONE);
|
||||
monitor=new SyncedProgressMonitor(progressBar);
|
||||
Job.getJobManager().setProgressProvider(new ProgressProvider() {
|
||||
@Override
|
||||
public IProgressMonitor createMonitor(Job job) {
|
||||
return monitor.addJob(job);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the heap status.
|
||||
*
|
||||
* @param parent the parent
|
||||
* @param toolControl the tool control
|
||||
*/
|
||||
private void createHeapStatus(Composite parent, MToolControl toolControl) {
|
||||
new HeapStatus(parent, osgiPreverences.getSystemPreferences());
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the status line.
|
||||
*
|
||||
@ -140,6 +101,14 @@ public class StatusBarControl {
|
||||
private void createStatusLine(Composite parent, MToolControl toolControl) {
|
||||
// IEclipseContext context = modelService.getContainingContext(toolControl);
|
||||
manager.createControl(parent);
|
||||
monitor=new SyncedProgressMonitor(manager.getProgressMonitor());
|
||||
Job.getJobManager().setProgressProvider(new ProgressProvider() {
|
||||
@Override
|
||||
public IProgressMonitor createMonitor(Job job) {
|
||||
return monitor.addJob(job);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -160,25 +129,17 @@ public class StatusBarControl {
|
||||
*/
|
||||
private final class SyncedProgressMonitor extends NullProgressMonitor {
|
||||
|
||||
// thread-Safe via thread confinement of the UI-Thread
|
||||
/** The running tasks. */
|
||||
// (means access only via UI-Thread)
|
||||
private long runningTasks = 0L;
|
||||
|
||||
/** The progress bar. */
|
||||
private ProgressBar progressBar;
|
||||
private IProgressMonitor progressBar;
|
||||
|
||||
/**
|
||||
* Instantiates a new synced progress monitor.
|
||||
*
|
||||
* @param progressBar the progress bar
|
||||
* @param iProgressMonitor the progress bar
|
||||
*/
|
||||
public SyncedProgressMonitor(ProgressBar progressBar) {
|
||||
public SyncedProgressMonitor(IProgressMonitor iProgressMonitor) {
|
||||
super();
|
||||
this.progressBar = progressBar;
|
||||
runningTasks=0;
|
||||
progressBar.setSelection(0);
|
||||
progressBar.setEnabled(false);
|
||||
this.progressBar = iProgressMonitor;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@ -189,13 +150,41 @@ public class StatusBarControl {
|
||||
sync.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
runningTasks++;
|
||||
if(runningTasks == 1) { // --- no task is running at the moment ---
|
||||
progressBar.setEnabled(true);
|
||||
progressBar.setSelection(0);
|
||||
}
|
||||
progressBar.setMaximum(totalWork);
|
||||
progressBar.setToolTipText(Messages.StatusBarControl_1 + runningTasks + Messages.StatusBarControl_2 + name);
|
||||
progressBar.beginTask(name, totalWork);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation does nothing.
|
||||
* Subclasses may override this method to do something
|
||||
* with the name of the task.
|
||||
*
|
||||
* @see IProgressMonitor#setTaskName(String)
|
||||
*/
|
||||
@Override
|
||||
public void setTaskName(String name) {
|
||||
sync.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressBar.setTaskName(name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation does nothing.
|
||||
* Subclasses may override this method to do interesting
|
||||
* processing when a subtask begins.
|
||||
*
|
||||
* @see IProgressMonitor#subTask(String)
|
||||
*/
|
||||
@Override
|
||||
public void subTask(String name) {
|
||||
sync.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressBar.subTask(name);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -208,7 +197,16 @@ public class StatusBarControl {
|
||||
sync.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressBar.setSelection(progressBar.getSelection() + work);
|
||||
progressBar.worked(work);
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
public void done() {
|
||||
sync.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressBar.done();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -228,14 +226,8 @@ public class StatusBarControl {
|
||||
@Override
|
||||
public void run() {
|
||||
if(event.getResult()==null) return;
|
||||
if(runningTasks>0) runningTasks--;
|
||||
if (runningTasks > 0){ // --- some tasks are still running ---
|
||||
progressBar.setToolTipText(Messages.StatusBarControl_3 + runningTasks);
|
||||
} else { // --- all tasks are done (a reset of selection could also be done) ---
|
||||
progressBar.setToolTipText(Messages.StatusBarControl_4);
|
||||
progressBar.setSelection(progressBar.getMaximum());
|
||||
progressBar.setEnabled(false);
|
||||
}
|
||||
if(!event.getResult().isOK())
|
||||
progressBar.done();
|
||||
}
|
||||
});
|
||||
// clean-up
|
||||
|
@ -0,0 +1,229 @@
|
||||
package com.minres.scviewer.e4.application.internal.status;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CLabel;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import org.eclipse.jface.action.ContributionItem;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.StatusLineLayoutData;
|
||||
import org.eclipse.jface.resource.JFaceColors;
|
||||
|
||||
|
||||
/**
|
||||
* Contribution item for the status line.
|
||||
* @since 2.0
|
||||
*/
|
||||
public class StatusLineContributionItem extends ContributionItem {
|
||||
|
||||
/**
|
||||
* Internal mouse listener to track double clicking the status line item.
|
||||
* @since 3.0
|
||||
*/
|
||||
private class Listener extends MouseAdapter {
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
if (fActionHandler != null && fActionHandler.isEnabled())
|
||||
fActionHandler.run();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Left and right margin used in CLabel.
|
||||
* @since 2.1
|
||||
*/
|
||||
private static final int INDENT= 3;
|
||||
/**
|
||||
* Default number of characters that should fit into the item.
|
||||
* @since 3.0
|
||||
*/
|
||||
static final int DEFAULT_WIDTH_IN_CHARS = 19;
|
||||
/**
|
||||
* Pre-computed label width hint.
|
||||
* @since 2.1
|
||||
*/
|
||||
private int fFixedWidth= -1;
|
||||
/**
|
||||
* Pre-computed label height hint.
|
||||
* @since 3.0
|
||||
*/
|
||||
private int fFixedHeight= -1;
|
||||
/** The text */
|
||||
private String fText;
|
||||
/** The image */
|
||||
private Image fImage;
|
||||
/**
|
||||
* The error text.
|
||||
* @since 3.0
|
||||
*/
|
||||
private String fErrorText;
|
||||
/**
|
||||
* The error image.
|
||||
* @since 3.0
|
||||
*/
|
||||
private Image fErrorImage;
|
||||
/**
|
||||
* The tool tip text.
|
||||
* @since 3.0
|
||||
*/
|
||||
private String fToolTipText;
|
||||
/**
|
||||
* Number of characters that should fit into the item.
|
||||
* @since 3.0
|
||||
*/
|
||||
private int fWidthInChars;
|
||||
/** The status line label widget */
|
||||
private CLabel fLabel;
|
||||
/**
|
||||
* The action handler.
|
||||
* @since 3.0
|
||||
*/
|
||||
private IAction fActionHandler;
|
||||
/**
|
||||
* The mouse listener
|
||||
* @since 3.0
|
||||
*/
|
||||
private MouseListener fMouseListener;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new item with the given attributes.
|
||||
*
|
||||
* @param id the item's id
|
||||
* @param visible the visibility of this item
|
||||
* @param widthInChars the width in characters
|
||||
* @since 3.0
|
||||
*/
|
||||
public StatusLineContributionItem(String id, boolean visible, int widthInChars) {
|
||||
super(id);
|
||||
setVisible(visible);
|
||||
fWidthInChars= widthInChars;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fill(Composite parent) {
|
||||
|
||||
Label sep= new Label(parent, SWT.SEPARATOR);
|
||||
CLabel label=new CLabel(parent, SWT.SHADOW_NONE);
|
||||
label.setText(getId());
|
||||
fLabel= new CLabel(parent, SWT.SHADOW_IN);
|
||||
fLabel.setAlignment(SWT.RIGHT);
|
||||
|
||||
fLabel.addDisposeListener(e -> fMouseListener = null);
|
||||
if (fActionHandler != null) {
|
||||
fMouseListener= new Listener();
|
||||
fLabel.addMouseListener(fMouseListener);
|
||||
}
|
||||
|
||||
StatusLineLayoutData data= new StatusLineLayoutData();
|
||||
data.widthHint= getWidthHint(parent);
|
||||
fLabel.setLayoutData(data);
|
||||
|
||||
data= new StatusLineLayoutData();
|
||||
data.heightHint= getHeightHint(parent);
|
||||
sep.setLayoutData(data);
|
||||
|
||||
updateMessageLabel();
|
||||
}
|
||||
|
||||
public void setActionHandler(IAction actionHandler) {
|
||||
if (fActionHandler != null && actionHandler == null && fMouseListener != null) {
|
||||
if (!fLabel.isDisposed())
|
||||
fLabel.removeMouseListener(fMouseListener);
|
||||
fMouseListener= null;
|
||||
}
|
||||
|
||||
fActionHandler= actionHandler;
|
||||
|
||||
if (fLabel != null && !fLabel.isDisposed() && fMouseListener == null && fActionHandler != null) {
|
||||
fMouseListener= new Listener();
|
||||
fLabel.addMouseListener(fMouseListener);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width hint for this label.
|
||||
*
|
||||
* @param control the root control of this label
|
||||
* @return the width hint for this label
|
||||
* @since 2.1
|
||||
*/
|
||||
private int getWidthHint(Composite control) {
|
||||
if (fFixedWidth < 0) {
|
||||
GC gc= new GC(control);
|
||||
gc.setFont(control.getFont());
|
||||
fFixedWidth = (int) gc.getFontMetrics().getAverageCharacterWidth() * fWidthInChars;
|
||||
fFixedWidth += INDENT * 2;
|
||||
gc.dispose();
|
||||
}
|
||||
return fFixedWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height hint for this label.
|
||||
*
|
||||
* @param control the root control of this label
|
||||
* @return the height hint for this label
|
||||
* @since 3.0
|
||||
*/
|
||||
private int getHeightHint(Composite control) {
|
||||
if (fFixedHeight < 0) {
|
||||
GC gc= new GC(control);
|
||||
gc.setFont(control.getFont());
|
||||
fFixedHeight= gc.getFontMetrics().getHeight();
|
||||
gc.dispose();
|
||||
}
|
||||
return fFixedHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the message label widget.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
private void updateMessageLabel() {
|
||||
if (fLabel != null && !fLabel.isDisposed()) {
|
||||
Display display= fLabel.getDisplay();
|
||||
if ((fErrorText != null && !fErrorText.isEmpty()) || fErrorImage != null) {
|
||||
fLabel.setForeground(JFaceColors.getErrorText(display));
|
||||
fLabel.setText(fErrorText);
|
||||
fLabel.setImage(fErrorImage);
|
||||
if (fToolTipText != null)
|
||||
fLabel.setToolTipText(fToolTipText);
|
||||
else if (fErrorText.length() > fWidthInChars)
|
||||
fLabel.setToolTipText(fErrorText);
|
||||
else
|
||||
fLabel.setToolTipText(null);
|
||||
|
||||
} else {
|
||||
fLabel.setForeground(fLabel.getParent().getForeground());
|
||||
fLabel.setText(fText);
|
||||
fLabel.setImage(fImage);
|
||||
if (fToolTipText != null)
|
||||
fLabel.setToolTipText(fToolTipText);
|
||||
else if (fText != null && fText.length() > fWidthInChars)
|
||||
fLabel.setToolTipText(fText);
|
||||
else
|
||||
fLabel.setToolTipText(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setText(String message){
|
||||
this.fText=message;
|
||||
updateMessageLabel();
|
||||
}
|
||||
|
||||
public void setErrorText(String message){
|
||||
this.fErrorText=message;
|
||||
updateMessageLabel();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,72 @@
|
||||
package com.minres.scviewer.e4.application.internal.status;
|
||||
|
||||
import org.eclipse.jface.action.ContributionItem;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CLabel;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
/**
|
||||
* The Class TextContributionItem.
|
||||
*/
|
||||
class TextContributionItem extends ContributionItem {
|
||||
|
||||
/** The label string. */
|
||||
final String labelString;
|
||||
|
||||
/** The text. */
|
||||
CLabel label, text;
|
||||
|
||||
/** The content. */
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* Instantiates a new text contribution item.
|
||||
*
|
||||
* @param labelString the label string
|
||||
*/
|
||||
public TextContributionItem(String labelString) {
|
||||
super();
|
||||
this.labelString = labelString;
|
||||
content=""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
public void fill(Composite parent) {
|
||||
Composite box=new Composite(parent, SWT.NONE); //NONE
|
||||
box.setLayout(new GridLayout(2, false));
|
||||
label=new CLabel(box, SWT.SHADOW_NONE);
|
||||
label.setText(labelString);
|
||||
text=new CLabel(box, SWT.SHADOW_IN);
|
||||
text.setAlignment(SWT.RIGHT);
|
||||
text.setText(" ");
|
||||
Point p = text.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
|
||||
layoutData.minimumWidth=12*p.x;
|
||||
text.setLayoutData(layoutData);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.ContributionItem#isDynamic()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text.
|
||||
*
|
||||
* @param message the new text
|
||||
*/
|
||||
public void setText(String message){
|
||||
this.content=message;
|
||||
if(text!=null && !text.isDisposed()) text.setText(content);
|
||||
}
|
||||
|
||||
}
|
@ -18,15 +18,8 @@ import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.e4.ui.di.UISynchronize;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EModelService;
|
||||
import org.eclipse.jface.action.ContributionItem;
|
||||
import org.eclipse.jface.action.StatusLineManager;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CLabel;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import com.minres.scviewer.e4.application.Messages;
|
||||
|
||||
/**
|
||||
@ -50,76 +43,9 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||
@Inject
|
||||
EModelService modelService;
|
||||
|
||||
/**
|
||||
* The Class TextContributionItem.
|
||||
*/
|
||||
class TextContributionItem extends ContributionItem {
|
||||
|
||||
/** The label string. */
|
||||
final String labelString;
|
||||
|
||||
/** The width. */
|
||||
//final int width;
|
||||
|
||||
/** The text. */
|
||||
CLabel label, text;
|
||||
|
||||
/** The content. */
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* Instantiates a new text contribution item.
|
||||
*
|
||||
* @param labelString the label string
|
||||
* @param width the width
|
||||
*/
|
||||
public TextContributionItem(String labelString /*, int width */) {
|
||||
super();
|
||||
this.labelString = labelString;
|
||||
//this.width=width;
|
||||
content=""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
public void fill(Composite parent) {
|
||||
Composite box=new Composite(parent, SWT.NONE); //NONE
|
||||
box.setLayout(new GridLayout(2, false));
|
||||
label=new CLabel(box, SWT.SHADOW_NONE);
|
||||
label.setText(labelString);
|
||||
text=new CLabel(box, SWT.SHADOW_IN);
|
||||
text.setAlignment(SWT.RIGHT);
|
||||
//GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
|
||||
GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
|
||||
layoutData.minimumWidth=70;
|
||||
//layoutData.minimumWidth=width;
|
||||
text.setLayoutData(layoutData);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.action.ContributionItem#isDynamic()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the text.
|
||||
*
|
||||
* @param message the new text
|
||||
*/
|
||||
public void setText(String message){
|
||||
this.content=message;
|
||||
if(text!=null && !text.isDisposed()) text.setText(content);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** The zoom contribution. */
|
||||
TextContributionItem cursorContribution, markerContribution, markerDiffContribution, zoomContribution;
|
||||
StatusLineContributionItem cursorContribution, markerContribution, markerDiffContribution, zoomContribution;
|
||||
|
||||
/**
|
||||
* Instantiates a new wave status bar control.
|
||||
@ -130,10 +56,10 @@ public class WaveStatusBarControl extends StatusBarControl {
|
||||
public WaveStatusBarControl(UISynchronize sync) {
|
||||
super(sync);
|
||||
|
||||
cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5 /*, 150 */); //150
|
||||
markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6 /*, 150 */); //150
|
||||
markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7 /*, 150 */); //150
|
||||
zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8 /*, 60 */); //60
|
||||
cursorContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_5, true, 20);
|
||||
markerContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_6, true, 20);
|
||||
markerDiffContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_7, true, 20);
|
||||
zoomContribution = new StatusLineContributionItem(Messages.WaveStatusBarControl_8, true, 8);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
|
||||
manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
|
||||
|
@ -18,7 +18,6 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeMap;
|
||||
import java.util.Vector;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -38,7 +37,6 @@ import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
import org.eclipse.jface.viewers.IDoubleClickListener;
|
||||
import org.eclipse.jface.viewers.IElementComparer;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
@ -152,15 +150,11 @@ public class TransactionDetails {
|
||||
|
||||
@Override
|
||||
public void treeCollapsed(TreeExpansionEvent event) {
|
||||
Object o = event.getElement();
|
||||
TreePath[] paths = treeViewer.getExpandedTreePaths();
|
||||
treeViewer.getSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void treeExpanded(TreeExpansionEvent event) {
|
||||
Object o = event.getElement();
|
||||
TreePath[] paths = treeViewer.getExpandedTreePaths();
|
||||
treeViewer.getSelection();
|
||||
}
|
||||
|
||||
|
@ -31,21 +31,18 @@ import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.core.internal.preferences.InstancePreferences;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.MultiStatus;
|
||||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.SubMonitor;
|
||||
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
|
||||
import org.eclipse.core.runtime.jobs.JobGroup;
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
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.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.di.extensions.Preference;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.ui.di.Focus;
|
||||
import org.eclipse.e4.ui.di.PersistState;
|
||||
@ -56,9 +53,7 @@ import org.eclipse.e4.ui.services.EMenuService;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
@ -84,7 +79,7 @@ import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.swt.widgets.Widget;
|
||||
import org.osgi.service.prefs.BackingStoreException;
|
||||
import org.osgi.service.prefs.Preferences;
|
||||
|
||||
import com.minres.scviewer.database.DataType;
|
||||
import com.minres.scviewer.database.ITx;
|
||||
@ -112,7 +107,6 @@ import com.minres.scviewer.e4.application.internal.util.FileMonitor;
|
||||
import com.minres.scviewer.e4.application.internal.util.IFileChangeListener;
|
||||
import com.minres.scviewer.e4.application.internal.util.IModificationChecker;
|
||||
import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
|
||||
import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
||||
|
||||
/**
|
||||
* The Class WaveformViewerPart.
|
||||
@ -194,7 +188,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
@Inject
|
||||
EPartService ePartService;
|
||||
|
||||
IPreferenceStore store = new ScopedPreferenceStore(ConfigurationScope.INSTANCE, PreferenceConstants.PREFERENCES_SCOPE);
|
||||
IEclipsePreferences store = null;
|
||||
|
||||
@Inject @Optional DesignBrowser designBrowser;
|
||||
|
||||
@ -211,7 +205,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
private Composite myParent;
|
||||
|
||||
/** The files to load. */
|
||||
ArrayList<File> filesToLoad;
|
||||
ArrayList<File> filesToLoad = new ArrayList<>();
|
||||
|
||||
/** The persisted state. */
|
||||
Map<String, String> persistedState;
|
||||
@ -231,6 +225,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
/** The file checker. */
|
||||
IModificationChecker fileChecker;
|
||||
|
||||
private Boolean showHover;
|
||||
|
||||
/**
|
||||
* Creates the composite.
|
||||
*
|
||||
@ -239,11 +235,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
* @param dbFactory the db factory
|
||||
*/
|
||||
@PostConstruct
|
||||
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
|
||||
public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory, @Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs, @Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
disposeListenerNumber += 1;
|
||||
|
||||
myPart = part;
|
||||
myParent = parent;
|
||||
store=prefs;
|
||||
showHover=hover;
|
||||
database = dbFactory.getDatabase();
|
||||
database.addPropertyChangeListener(new PropertyChangeListener() {
|
||||
@Override
|
||||
@ -260,7 +258,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
});
|
||||
waveformPane = factory.createPanel(parent);
|
||||
waveformPane.setMaxTime(0);
|
||||
|
||||
setupColors();
|
||||
//set selection to empty selection when opening a new waveformPane
|
||||
selectionService.setSelection(new StructuredSelection());
|
||||
|
||||
@ -348,8 +346,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
});
|
||||
|
||||
zoomLevel = waveformPane.getZoomLevels();
|
||||
setupColors();
|
||||
checkForUpdates = store.getBoolean(PreferenceConstants.DATABASE_RELOAD);
|
||||
checkForUpdates = store.getBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
||||
filesToLoad = new ArrayList<File>();
|
||||
persistedState = part.getPersistedState();
|
||||
Integer files = persistedState.containsKey(DATABASE_FILE + "S") //$NON-NLS-1$
|
||||
@ -378,23 +375,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
}
|
||||
}
|
||||
});
|
||||
store.addPropertyChangeListener(new IPropertyChangeListener() {
|
||||
@Override
|
||||
public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
|
||||
if (PreferenceConstants.DATABASE_RELOAD.equals(event.getProperty())) {
|
||||
checkForUpdates = (Boolean)event.getNewValue();
|
||||
fileChecker = null;
|
||||
if (checkForUpdates)
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad,
|
||||
FILE_CHECK_INTERVAL);
|
||||
else
|
||||
fileMonitor.removeFileChangeListener(WaveformViewer.this);
|
||||
} else if (!PreferenceConstants.SHOW_HOVER.equals(event.getProperty())){
|
||||
setupColors();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
waveformPane.addDisposeListener(this);
|
||||
|
||||
waveformPane.getWaveformControl().setData(Constants.HELP_PROVIDER_TAG, new ToolTipHelpTextProvider() {
|
||||
@ -406,7 +386,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
waveformPane.getWaveformControl().setData(Constants.CONTENT_PROVIDER_TAG, new ToolTipContentProvider() {
|
||||
@Override
|
||||
public boolean createContent(Composite parent, Point pt) {
|
||||
if(!store.getBoolean(PreferenceConstants.SHOW_HOVER)) return false;
|
||||
if(!showHover) return false;
|
||||
List<Object> res = waveformPane.getElementsAt(pt);
|
||||
if(res.size()>0)
|
||||
if(res.get(0) instanceof ITx) {
|
||||
@ -476,8 +456,6 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
final Font font = new Font(Display.getCurrent(), "Terminal", 10, SWT.NORMAL);
|
||||
|
||||
final Label label = new Label(parent, SWT.NONE);
|
||||
//label.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||
//label.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
|
||||
label.setText(te.waveform.getFullName());
|
||||
label.setFont(font);
|
||||
GridData labelGridData = new GridData();
|
||||
@ -491,35 +469,49 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
});
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnPrefsChange(@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE) IEclipsePreferences prefs) {
|
||||
prefs.addPreferenceChangeListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnShowHoverChange(@Preference(value = PreferenceConstants.SHOW_HOVER) Boolean hover) {
|
||||
showHover=hover;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
public void reactOnReloadDatabaseChange(@Preference(value = PreferenceConstants.DATABASE_RELOAD) Boolean checkForUpdates) {
|
||||
if (checkForUpdates) {
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad, FILE_CHECK_INTERVAL);
|
||||
} else {
|
||||
fileMonitor.removeFileChangeListener(WaveformViewer.this);
|
||||
fileChecker = null;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
|
||||
*/
|
||||
@Override
|
||||
public void preferenceChange(PreferenceChangeEvent event) {
|
||||
InstancePreferences pref = (InstancePreferences)event.getSource();
|
||||
if (PreferenceConstants.DATABASE_RELOAD.equals(event.getKey())) {
|
||||
checkForUpdates = pref.getBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
||||
fileChecker = null;
|
||||
if (checkForUpdates)
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad,
|
||||
FILE_CHECK_INTERVAL);
|
||||
else
|
||||
fileMonitor.removeFileChangeListener(this);
|
||||
} else if (!PreferenceConstants.SHOW_HOVER.equals(event.getKey())){
|
||||
if (!PreferenceConstants.DATABASE_RELOAD.equals(event.getKey()) && !PreferenceConstants.SHOW_HOVER.equals(event.getKey())){
|
||||
setupColors();
|
||||
}
|
||||
try {
|
||||
pref.flush();
|
||||
} catch (BackingStoreException e) { }
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup colors.
|
||||
*/
|
||||
protected void setupColors() {
|
||||
Preferences defaultPrefs= store.parent().parent().node("/"+DefaultScope.SCOPE+"/"+PreferenceConstants.PREFERENCES_SCOPE);
|
||||
HashMap<WaveformColors, RGB> colorPref = new HashMap<>();
|
||||
for (WaveformColors c : WaveformColors.values()) {
|
||||
String prefValue = store.getString(c.name() + "_COLOR"); //$NON-NLS-1$
|
||||
String key = c.name() + "_COLOR";
|
||||
String prefValue = store.get(key, defaultPrefs.get(key, "")); //$NON-NLS-1$
|
||||
RGB rgb = StringConverter.asRGB(prefValue);
|
||||
colorPref.put(c, rgb);
|
||||
}
|
||||
@ -535,9 +527,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
monitor.setTaskName(Messages.WaveformViewer_16+file.getName());
|
||||
boolean res = database.load(file);
|
||||
monitor.done();
|
||||
database.addPropertyChangeListener(waveformPane);
|
||||
return res?Status.OK_STATUS:Status.CANCEL_STATUS;
|
||||
}
|
||||
@ -549,15 +539,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
*/
|
||||
protected void loadDatabase(final Map<String, String> state) {
|
||||
fileMonitor.removeFileChangeListener(this);
|
||||
MultiStatus fStatus= new MultiStatus("blah", IStatus.OK, Messages.WaveformViewer_13, null);
|
||||
Job job = new Job(Messages.WaveformViewer_15) {
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
SubMonitor subMonitor = SubMonitor.convert(monitor, filesToLoad.size());
|
||||
IProgressMonitor progressGroup = getJobManager().createProgressGroup();
|
||||
JobGroup jobGroup = new JobGroup(Messages.WaveformViewer_15, filesToLoad.size(), filesToLoad.size());
|
||||
filesToLoad.forEach((final File file) -> {
|
||||
Job job = new DbLoadJob(Messages.WaveformViewer_16 + file.getName(), file);
|
||||
job.setProgressGroup(subMonitor, 1);
|
||||
job.setProgressGroup(progressGroup, 1);
|
||||
job.setJobGroup(jobGroup);
|
||||
job.schedule();
|
||||
});
|
||||
@ -569,34 +558,28 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
|
||||
if (monitor.isCanceled())
|
||||
throw new OperationCanceledException(Messages.WaveformViewer_14);
|
||||
|
||||
fStatus.addAll(jobGroup.getResult());
|
||||
return fStatus;
|
||||
}
|
||||
};
|
||||
job.addJobChangeListener(new JobChangeAdapter() {
|
||||
@Override
|
||||
public void done(IJobChangeEvent event) {
|
||||
IStatus result = event.getResult();
|
||||
|
||||
IStatus result = jobGroup.getResult();
|
||||
if( (!result.isMultiStatus() && result.getCode() != Status.OK_STATUS.getCode() ) ||
|
||||
(result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){
|
||||
(result.isMultiStatus() && result.getChildren().length > 0 && result.getChildren()[0].getCode() != Status.OK_STATUS.getCode() ) ){
|
||||
// kill editor and pop up warning for user
|
||||
sync.asyncExec(() -> {
|
||||
final Display display = myParent.getDisplay();
|
||||
MessageDialog.openWarning(display.getActiveShell(), "Error loading database", "Database cannot be loaded. Aborting...");
|
||||
ePartService.hidePart(myPart, true);
|
||||
ePartService.hidePart(myPart, true);
|
||||
});
|
||||
return;
|
||||
}
|
||||
sync.asyncExec(()->{
|
||||
waveformPane.setMaxTime(database.getMaxTime());
|
||||
if (state != null)
|
||||
restoreWaveformViewerState(state);
|
||||
fileChecker = null;
|
||||
if (checkForUpdates)
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad, FILE_CHECK_INTERVAL);
|
||||
});
|
||||
} else
|
||||
sync.asyncExec(()->{
|
||||
waveformPane.setMaxTime(database.getMaxTime());
|
||||
if (state != null)
|
||||
restoreWaveformViewerState(state);
|
||||
fileChecker = null;
|
||||
if (checkForUpdates)
|
||||
fileChecker = fileMonitor.addFileChangeListener(WaveformViewer.this, filesToLoad, FILE_CHECK_INTERVAL);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
});
|
||||
};
|
||||
job.setSystem(true);
|
||||
job.schedule(1000L); // let the UI initialize so that we have a progress monitor
|
||||
}
|
||||
|
@ -12,14 +12,14 @@ package com.minres.scviewer.e4.application.preferences;
|
||||
|
||||
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
|
||||
import org.eclipse.core.runtime.preferences.DefaultScope;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.wb.swt.SWTResourceManager;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
|
||||
import com.minres.scviewer.database.ui.WaveformColors;
|
||||
import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
||||
|
||||
/**
|
||||
* The Class DefaultValuesInitializer.
|
||||
@ -27,7 +27,7 @@ import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
||||
public class DefaultValuesInitializer extends AbstractPreferenceInitializer {
|
||||
|
||||
/** The default colors. */
|
||||
public final Color[] colors = new Color[WaveformColors.values().length];
|
||||
public static final Color[] colors = new Color[WaveformColors.values().length];
|
||||
|
||||
/**
|
||||
* Instantiates a new default values initializer.
|
||||
@ -64,21 +64,12 @@ public class DefaultValuesInitializer extends AbstractPreferenceInitializer {
|
||||
*/
|
||||
@Override
|
||||
public void initializeDefaultPreferences() {
|
||||
// IEclipsePreferences node = DefaultScope.INSTANCE.getNode(PreferenceConstants.PREFERENCES_SCOPE);
|
||||
// if (node != null)
|
||||
// {
|
||||
// node.putBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
||||
// node.putBoolean(PreferenceConstants.SHOW_HOVER, true);
|
||||
// for (WaveformColors c : WaveformColors.values()) {
|
||||
// node.put(c.name()+"_COLOR", StringConverter.asString(colors[c.ordinal()].getRGB())); //$NON-NLS-1$
|
||||
// }
|
||||
// }
|
||||
IPreferenceStore store = new ScopedPreferenceStore(DefaultScope.INSTANCE, PreferenceConstants.PREFERENCES_SCOPE);
|
||||
|
||||
store.setDefault(PreferenceConstants.DATABASE_RELOAD, true);
|
||||
store.setDefault(PreferenceConstants.SHOW_HOVER, true);
|
||||
IEclipsePreferences store = DefaultScope.INSTANCE.getNode(FrameworkUtil.getBundle(getClass()).getSymbolicName());
|
||||
|
||||
store.putBoolean(PreferenceConstants.DATABASE_RELOAD, true);
|
||||
store.putBoolean(PreferenceConstants.SHOW_HOVER, true);
|
||||
for (WaveformColors c : WaveformColors.values()) {
|
||||
store.setDefault(c.name()+"_COLOR", StringConverter.asString(colors[c.ordinal()].getRGB())); //$NON-NLS-1$
|
||||
store.put(c.name()+"_COLOR", StringConverter.asString(colors[c.ordinal()].getRGB())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
package com.minres.scviewer.e4.application.preferences;
|
||||
import org.eclipse.core.runtime.preferences.ConfigurationScope;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
|
||||
import com.opcoach.e4.preferences.IPreferenceStoreProvider;
|
||||
import com.opcoach.e4.preferences.ScopedPreferenceStore;
|
||||
|
||||
public class PreferencesStoreProvider implements IPreferenceStoreProvider{
|
||||
|
||||
public PreferencesStoreProvider(){
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPreferenceStore getPreferenceStore() {
|
||||
return new ScopedPreferenceStore(ConfigurationScope.INSTANCE, PreferenceConstants.PREFERENCES_SCOPE);
|
||||
}
|
||||
|
||||
}
|
9
pom.xml
9
pom.xml
@ -20,6 +20,7 @@
|
||||
<module>features/com.minres.scviewer.database.feature</module>
|
||||
<module>features/com.minres.scviewer.ui.feature</module>
|
||||
<module>features/com.minres.scviewer.feature</module>
|
||||
<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>
|
||||
@ -39,7 +40,7 @@
|
||||
<version>${tycho-version}</version>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
|
||||
<!--
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-source-plugin</artifactId>
|
||||
@ -55,7 +56,7 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho.extras</groupId>
|
||||
<artifactId>tycho-source-feature-plugin</artifactId>
|
||||
<version>${tycho-version}</version>
|
||||
@ -72,12 +73,12 @@
|
||||
|
||||
<configuration>
|
||||
<excludes>
|
||||
<!-- provide plug-ins not containing any source code -->
|
||||
provide plug-ins not containing any source code
|
||||
<plugin id="org.codehaus.groovy" />
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>tycho-p2-plugin</artifactId>
|
||||
|
@ -72,6 +72,7 @@
|
||||
<setEntry value="org.eclipse.equinox.app@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.bidi@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.common@2:true"/>
|
||||
<setEntry value="org.eclipse.equinox.ds@1:true"/>
|
||||
<setEntry value="org.eclipse.equinox.preferences@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.registry@default:default"/>
|
||||
<setEntry value="org.eclipse.equinox.util@default:default"/>
|
||||
|
Reference in New Issue
Block a user