Compare commits
	
		
			55 Commits
		
	
	
		
			2.0.3
			...
			#27_trunca
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f1abc645c3 | |||
| 2c8b7129e9 | |||
| 8f76d816f1 | |||
| 594a71a9ba | |||
| 97443c6cd8 | |||
| c3486eb6c8 | |||
| 8a286a8eac | |||
| e4329213fa | |||
| 857bbe17d7 | |||
| 091cb1cf7f | |||
| 
						 | 
					0623b8de4a | ||
| 
						 | 
					8b55548cca | ||
| a0a4ea1f53 | |||
| e034d1faad | |||
| 68660d0892 | |||
| a0f0b55045 | |||
| 3d20b6961e | |||
| 
						 | 
					ca02c92a18 | ||
| 347dbf134b | |||
| 
						 | 
					44ac32359f | ||
| 48c7d81b8a | |||
| e945a3acbe | |||
| 145dfbd74d | |||
| b7646dc29e | |||
| 
						 | 
					475181c8df | ||
| 
						 | 
					3d043ce1b7 | ||
| 
						 | 
					7e2869b7ee | ||
| 51d9d7e25c | |||
| ed665ac032 | |||
| 689d7874f4 | |||
| 
						 | 
					c7c1f97b0c | ||
| 
						 | 
					7b2db09585 | ||
| 
						 | 
					52f3f7b348 | ||
| 429ea37080 | |||
| 04f011e82f | |||
| 
						 | 
					3a6ed3ce7e | ||
| 79eb8073d8 | |||
| 4ea841cc7b | |||
| 6bf642d2af | |||
| 
						 | 
					15c24f0925 | ||
| 
						 | 
					4d4a6579c6 | ||
| b648dccfd8 | |||
| f9425834a3 | |||
| e0d00e6402 | |||
| b1b7517759 | |||
| a5b9c28007 | |||
| b5e408595b | |||
| f15930682e | |||
| 
						 | 
					f8765518bc | ||
| 
						 | 
					73e952faea | ||
| 111383bcba | |||
| 244f005ae6 | |||
| 701733e69d | |||
| 6b4a9c1e14 | |||
| 3abbc3e0e2 | 
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
@@ -5,10 +5,7 @@ Bundle-SymbolicName: com.minres.scviewer.database.sqlite
 | 
				
			|||||||
Bundle-Version: 1.0.0.qualifier
 | 
					Bundle-Version: 1.0.0.qualifier
 | 
				
			||||||
Bundle-Vendor: MINRES Technologies GmbH
 | 
					Bundle-Vendor: MINRES Technologies GmbH
 | 
				
			||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
					Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
				
			||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
 | 
					Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0"
 | 
				
			||||||
 org.eclipse.equinox.util;bundle-version="1.0.500",
 | 
					 | 
				
			||||||
 org.eclipse.equinox.ds;bundle-version="1.4.200",
 | 
					 | 
				
			||||||
 org.eclipse.osgi.services;bundle-version="3.4.0"
 | 
					 | 
				
			||||||
Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
 | 
					Bundle-ClassPath: .,sqlite-jdbc-3.8.7.jar
 | 
				
			||||||
Service-Component: OSGI-INF/component.xml
 | 
					Service-Component: OSGI-INF/component.xml
 | 
				
			||||||
Bundle-ActivationPolicy: lazy
 | 
					Bundle-ActivationPolicy: lazy
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,10 @@
 | 
				
			|||||||
<classpath>
 | 
					<classpath>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
						<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
						<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
				
			||||||
	<classpathentry kind="src" path="src"/>
 | 
						<classpathentry kind="src" path="src/">
 | 
				
			||||||
 | 
							<attributes>
 | 
				
			||||||
 | 
								<attribute name="test" value="true"/>
 | 
				
			||||||
 | 
							</attributes>
 | 
				
			||||||
 | 
						</classpathentry>
 | 
				
			||||||
	<classpathentry kind="output" path="target/classes"/>
 | 
						<classpathentry kind="output" path="target/classes"/>
 | 
				
			||||||
</classpath>
 | 
					</classpath>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding//src/com/minres/scviewer/database/test/DatabaseServicesTest.java=UTF-8
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
							
								
								
									
										238
									
								
								com.minres.scviewer.database.test/inputs/my_db_truncated.txlog
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										238
									
								
								com.minres.scviewer.database.test/inputs/my_db_truncated.txlog
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,238 @@
 | 
				
			|||||||
 | 
					scv_tr_stream (ID 1, name "tr.pipelined_stream", kind "transactor")
 | 
				
			||||||
 | 
					scv_tr_stream (ID 2, name "tr.addr_stream", kind "transactor")
 | 
				
			||||||
 | 
					scv_tr_stream (ID 3, name "tr.data_stream", kind "transactor")
 | 
				
			||||||
 | 
					scv_tr_generator (ID 4, name "read", scv_tr_stream 1,
 | 
				
			||||||
 | 
					begin_attribute (ID 0, name "addr", type "UNSIGNED")
 | 
				
			||||||
 | 
					end_attribute (ID 1, name "data", type "UNSIGNED")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					scv_tr_generator (ID 5, name "write", scv_tr_stream 1,
 | 
				
			||||||
 | 
					begin_attribute (ID 0, name "addr", type "UNSIGNED")
 | 
				
			||||||
 | 
					end_attribute (ID 1, name "data", type "UNSIGNED")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					scv_tr_generator (ID 6, name "addr", scv_tr_stream 2,
 | 
				
			||||||
 | 
					begin_attribute (ID 0, name "addr", type "UNSIGNED")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					scv_tr_generator (ID 7, name "rdata", scv_tr_stream 3,
 | 
				
			||||||
 | 
					end_attribute (ID 0, name "data", type "UNSIGNED")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					scv_tr_generator (ID 8, name "wdata", scv_tr_stream 3,
 | 
				
			||||||
 | 
					begin_attribute (ID 0, name "data", type "UNSIGNED")
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					tx_begin 1 4 0 s
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_record_attribute 1 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 2 6 0 s
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 2 1
 | 
				
			||||||
 | 
					tx_end 2 6 180 ns
 | 
				
			||||||
 | 
					tx_begin 3 7 180 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 3 1
 | 
				
			||||||
 | 
					tx_begin 4 4 180 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_record_attribute 4 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 5 6 180 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 5 4
 | 
				
			||||||
 | 
					tx_end 5 6 300 ns
 | 
				
			||||||
 | 
					tx_end 3 7 420 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_end 1 4 420 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_begin 6 4 420 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_record_attribute 6 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 7 6 420 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 7 6
 | 
				
			||||||
 | 
					tx_begin 8 7 420 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 8 4
 | 
				
			||||||
 | 
					tx_end 7 6 480 ns
 | 
				
			||||||
 | 
					tx_end 8 7 620 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_end 4 4 620 ns
 | 
				
			||||||
 | 
					a 0
 | 
				
			||||||
 | 
					tx_begin 9 4 620 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_record_attribute 9 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 10 6 620 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 10 9
 | 
				
			||||||
 | 
					tx_begin 11 7 620 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 11 6
 | 
				
			||||||
 | 
					tx_end 11 7 700 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_end 6 4 700 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_end 10 6 760 ns
 | 
				
			||||||
 | 
					tx_begin 12 7 760 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 12 9
 | 
				
			||||||
 | 
					tx_begin 13 4 760 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_record_attribute 13 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 14 6 760 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 14 13
 | 
				
			||||||
 | 
					tx_end 14 6 880 ns
 | 
				
			||||||
 | 
					tx_end 12 7 980 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_end 9 4 980 ns
 | 
				
			||||||
 | 
					a 1
 | 
				
			||||||
 | 
					tx_begin 15 4 980 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_record_attribute 15 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 16 6 980 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 16 15
 | 
				
			||||||
 | 
					tx_begin 17 7 980 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 17 13
 | 
				
			||||||
 | 
					tx_end 16 6 1040 ns
 | 
				
			||||||
 | 
					tx_end 17 7 1200 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_end 13 4 1200 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_begin 18 4 1200 ns
 | 
				
			||||||
 | 
					a 120
 | 
				
			||||||
 | 
					tx_record_attribute 18 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 19 6 1200 ns
 | 
				
			||||||
 | 
					a 120
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 19 18
 | 
				
			||||||
 | 
					tx_begin 20 7 1200 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 20 15
 | 
				
			||||||
 | 
					tx_end 19 6 1300 ns
 | 
				
			||||||
 | 
					tx_end 20 7 1340 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_end 15 4 1340 ns
 | 
				
			||||||
 | 
					a 2
 | 
				
			||||||
 | 
					tx_begin 21 4 1340 ns
 | 
				
			||||||
 | 
					a 11
 | 
				
			||||||
 | 
					tx_record_attribute 21 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 22 6 1340 ns
 | 
				
			||||||
 | 
					a 11
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 22 21
 | 
				
			||||||
 | 
					tx_begin 23 7 1340 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 23 18
 | 
				
			||||||
 | 
					tx_end 23 7 1420 ns
 | 
				
			||||||
 | 
					a 120
 | 
				
			||||||
 | 
					tx_end 18 4 1420 ns
 | 
				
			||||||
 | 
					a 120
 | 
				
			||||||
 | 
					tx_end 22 6 1540 ns
 | 
				
			||||||
 | 
					tx_begin 24 7 1540 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 24 21
 | 
				
			||||||
 | 
					tx_begin 25 4 1540 ns
 | 
				
			||||||
 | 
					a 147
 | 
				
			||||||
 | 
					tx_record_attribute 25 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 26 6 1540 ns
 | 
				
			||||||
 | 
					a 147
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 26 25
 | 
				
			||||||
 | 
					tx_end 24 7 1660 ns
 | 
				
			||||||
 | 
					a 11
 | 
				
			||||||
 | 
					tx_end 21 4 1660 ns
 | 
				
			||||||
 | 
					a 11
 | 
				
			||||||
 | 
					tx_end 26 6 1740 ns
 | 
				
			||||||
 | 
					tx_begin 27 7 1740 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 27 25
 | 
				
			||||||
 | 
					tx_begin 28 4 1740 ns
 | 
				
			||||||
 | 
					a 99
 | 
				
			||||||
 | 
					tx_record_attribute 28 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 29 6 1740 ns
 | 
				
			||||||
 | 
					a 99
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 29 28
 | 
				
			||||||
 | 
					tx_end 29 6 1800 ns
 | 
				
			||||||
 | 
					tx_end 27 7 1980 ns
 | 
				
			||||||
 | 
					a 147
 | 
				
			||||||
 | 
					tx_end 25 4 1980 ns
 | 
				
			||||||
 | 
					a 147
 | 
				
			||||||
 | 
					tx_begin 30 4 1980 ns
 | 
				
			||||||
 | 
					a 55
 | 
				
			||||||
 | 
					tx_record_attribute 30 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 31 6 1980 ns
 | 
				
			||||||
 | 
					a 55
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 31 30
 | 
				
			||||||
 | 
					tx_begin 32 7 1980 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 32 28
 | 
				
			||||||
 | 
					tx_end 32 7 2060 ns
 | 
				
			||||||
 | 
					a 99
 | 
				
			||||||
 | 
					tx_end 28 4 2060 ns
 | 
				
			||||||
 | 
					a 99
 | 
				
			||||||
 | 
					tx_end 31 6 2100 ns
 | 
				
			||||||
 | 
					tx_begin 33 7 2100 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 33 30
 | 
				
			||||||
 | 
					tx_begin 34 4 2100 ns
 | 
				
			||||||
 | 
					a 126
 | 
				
			||||||
 | 
					tx_record_attribute 34 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 35 6 2100 ns
 | 
				
			||||||
 | 
					a 126
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 35 34
 | 
				
			||||||
 | 
					tx_end 33 7 2340 ns
 | 
				
			||||||
 | 
					a 55
 | 
				
			||||||
 | 
					tx_end 30 4 2340 ns
 | 
				
			||||||
 | 
					a 55
 | 
				
			||||||
 | 
					tx_end 35 6 2340 ns
 | 
				
			||||||
 | 
					tx_begin 36 7 2340 ns
 | 
				
			||||||
 | 
					tx_relation "data_phase" 36 34
 | 
				
			||||||
 | 
					tx_begin 37 5 2340 ns
 | 
				
			||||||
 | 
					a 204
 | 
				
			||||||
 | 
					tx_record_attribute 37 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 38 6 2340 ns
 | 
				
			||||||
 | 
					a 204
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 38 37
 | 
				
			||||||
 | 
					tx_end 38 6 2400 ns
 | 
				
			||||||
 | 
					tx_end 36 7 2540 ns
 | 
				
			||||||
 | 
					a 126
 | 
				
			||||||
 | 
					tx_end 34 4 2540 ns
 | 
				
			||||||
 | 
					a 126
 | 
				
			||||||
 | 
					tx_begin 39 5 2540 ns
 | 
				
			||||||
 | 
					a 242
 | 
				
			||||||
 | 
					tx_record_attribute 39 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 40 6 2540 ns
 | 
				
			||||||
 | 
					a 242
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 40 39
 | 
				
			||||||
 | 
					tx_begin 41 8 2540 ns
 | 
				
			||||||
 | 
					a 211
 | 
				
			||||||
 | 
					tx_relation "data_phase" 41 37
 | 
				
			||||||
 | 
					tx_end 41 8 2640 ns
 | 
				
			||||||
 | 
					tx_end 37 5 2640 ns
 | 
				
			||||||
 | 
					a 211
 | 
				
			||||||
 | 
					tx_end 40 6 2780 ns
 | 
				
			||||||
 | 
					tx_begin 42 8 2780 ns
 | 
				
			||||||
 | 
					a 58
 | 
				
			||||||
 | 
					tx_relation "data_phase" 42 39
 | 
				
			||||||
 | 
					tx_begin 43 5 2780 ns
 | 
				
			||||||
 | 
					a 135
 | 
				
			||||||
 | 
					tx_record_attribute 43 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 44 6 2780 ns
 | 
				
			||||||
 | 
					a 135
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 44 43
 | 
				
			||||||
 | 
					tx_end 44 6 2960 ns
 | 
				
			||||||
 | 
					tx_end 42 8 3 us
 | 
				
			||||||
 | 
					tx_end 39 5 3 us
 | 
				
			||||||
 | 
					a 58
 | 
				
			||||||
 | 
					tx_begin 45 5 3 us
 | 
				
			||||||
 | 
					a 26
 | 
				
			||||||
 | 
					tx_record_attribute 45 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 46 6 3 us
 | 
				
			||||||
 | 
					a 26
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 46 45
 | 
				
			||||||
 | 
					tx_begin 47 8 3 us
 | 
				
			||||||
 | 
					a 31
 | 
				
			||||||
 | 
					tx_relation "data_phase" 47 43
 | 
				
			||||||
 | 
					tx_end 47 8 3140 ns
 | 
				
			||||||
 | 
					tx_end 43 5 3140 ns
 | 
				
			||||||
 | 
					a 31
 | 
				
			||||||
 | 
					tx_end 46 6 3200 ns
 | 
				
			||||||
 | 
					tx_begin 48 8 3200 ns
 | 
				
			||||||
 | 
					a 37
 | 
				
			||||||
 | 
					tx_relation "data_phase" 48 45
 | 
				
			||||||
 | 
					tx_begin 49 5 3200 ns
 | 
				
			||||||
 | 
					a 176
 | 
				
			||||||
 | 
					tx_record_attribute 49 "data_size" UNSIGNED = 24
 | 
				
			||||||
 | 
					tx_begin 50 6 3200 ns
 | 
				
			||||||
 | 
					a 176
 | 
				
			||||||
 | 
					tx_relation "addr_phase" 50 49
 | 
				
			||||||
 | 
					tx_end 50 6 3300 ns
 | 
				
			||||||
 | 
					tx_end 48 8 3380 ns
 | 
				
			||||||
 | 
					tx_end 45 5 3380 ns
 | 
				
			||||||
 | 
					a 37
 | 
				
			||||||
 | 
					tx_begin 51 5 3380 ns
 | 
				
			||||||
 | 
					a 58
 | 
				
			||||||
 | 
					tx_record_attribute 51 "data_
 | 
				
			||||||
@@ -14,7 +14,7 @@
 | 
				
			|||||||
			<plugin>
 | 
								<plugin>
 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
				<artifactId>tycho-surefire-plugin</artifactId>
 | 
									<artifactId>tycho-surefire-plugin</artifactId>
 | 
				
			||||||
				<version>0.23.1</version>
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
				<configuration>
 | 
									<configuration>
 | 
				
			||||||
<!-- 					<bundleStartLevel /> -->
 | 
					<!-- 					<bundleStartLevel /> -->
 | 
				
			||||||
					<dependencies>
 | 
										<dependencies>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -100,6 +100,16 @@ public class DatabaseServicesTest {
 | 
				
			|||||||
		assertEquals(1,  waveformDb.getChildNodes().size());
 | 
							assertEquals(1,  waveformDb.getChildNodes().size());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						@Test
 | 
				
			||||||
 | 
						public void testTxTextTruncated() throws Exception {
 | 
				
			||||||
 | 
							File f = new File("inputs/my_db_truncated.txlog").getAbsoluteFile();
 | 
				
			||||||
 | 
							assertTrue(f.exists());
 | 
				
			||||||
 | 
							waveformDb.load(f);
 | 
				
			||||||
 | 
							assertNotNull(waveformDb);
 | 
				
			||||||
 | 
							assertEquals(3,  waveformDb.getAllWaves().size());
 | 
				
			||||||
 | 
							assertEquals(1,  waveformDb.getChildNodes().size());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//@Test
 | 
						//@Test
 | 
				
			||||||
	public void testTxLDb() throws Exception {
 | 
						public void testTxLDb() throws Exception {
 | 
				
			||||||
		File f = new File("inputs/my_ldb.txldb").getAbsoluteFile();
 | 
							File f = new File("inputs/my_ldb.txldb").getAbsoluteFile();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,19 +1,22 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
<classpath>
 | 
					<classpath>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/elsa-3.0.0-M5.jar"/>
 | 
						<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-9.2.0.jar"/>
 | 
							<attributes>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-api-9.2.0.jar"/>
 | 
								<attribute name="maven.pomderived" value="true"/>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-forkjoin-9.2.0.jar"/>
 | 
							</attributes>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/kotlin-stdlib-1.2.42.jar"/>
 | 
						</classpathentry>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/lz4-1.3.0.jar"/>
 | 
						<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
				
			||||||
	<classpathentry exported="true" kind="lib" path="lib/mapdb-3.0.7.jar" sourcepath="lib/mapdb-3.0.7-sources.jar">
 | 
						<classpathentry exported="true" kind="lib" path="lib/mapdb-3.0.7.jar" sourcepath="lib/mapdb-3.0.7-sources.jar">
 | 
				
			||||||
		<attributes>
 | 
							<attributes>
 | 
				
			||||||
			<attribute name="javadoc_location" value="jar:platform:/resource/com.minres.scviewer.database.text/lib/mapdb-3.0.7-javadoc.jar!/"/>
 | 
								<attribute name="javadoc_location" value="jar:platform:/resource/com.minres.scviewer.database.text/lib/mapdb-3.0.7-javadoc.jar!/"/>
 | 
				
			||||||
		</attributes>
 | 
							</attributes>
 | 
				
			||||||
	</classpathentry>
 | 
						</classpathentry>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
						<classpathentry kind="src" path="src/"/>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
						<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-9.2.0.jar"/>
 | 
				
			||||||
	<classpathentry kind="src" path="src"/>
 | 
						<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-api-9.2.0.jar"/>
 | 
				
			||||||
	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
 | 
						<classpathentry exported="true" kind="lib" path="lib/eclipse-collections-forkjoin-9.2.0.jar"/>
 | 
				
			||||||
 | 
						<classpathentry exported="true" kind="lib" path="lib/kotlin-stdlib-1.2.42.jar"/>
 | 
				
			||||||
 | 
						<classpathentry exported="true" kind="lib" path="lib/lz4-1.3.0.jar"/>
 | 
				
			||||||
 | 
						<classpathentry exported="true" kind="lib" path="lib/elsa-3.0.0-M5.jar"/>
 | 
				
			||||||
	<classpathentry kind="output" path="target/classes"/>
 | 
						<classpathentry kind="output" path="target/classes"/>
 | 
				
			||||||
</classpath>
 | 
					</classpath>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.8
 | 
				
			|||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 | 
					org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 | 
				
			||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 | 
					org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 | 
				
			||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
 | 
					org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
 | 
				
			||||||
 | 
					org.eclipse.jdt.core.compiler.release=disabled
 | 
				
			||||||
org.eclipse.jdt.core.compiler.source=1.8
 | 
					org.eclipse.jdt.core.compiler.source=1.8
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					eclipse.preferences.version=1
 | 
				
			||||||
groovy.compiler.level=26
 | 
					groovy.compiler.level=25
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,12 +2,12 @@ Manifest-Version: 1.0
 | 
				
			|||||||
Bundle-ManifestVersion: 2
 | 
					Bundle-ManifestVersion: 2
 | 
				
			||||||
Bundle-Name: Textual transaction database
 | 
					Bundle-Name: Textual transaction database
 | 
				
			||||||
Bundle-SymbolicName: com.minres.scviewer.database.text
 | 
					Bundle-SymbolicName: com.minres.scviewer.database.text
 | 
				
			||||||
Bundle-Version: 2.0.0.qualifier
 | 
					Bundle-Version: 2.0.1.qualifier
 | 
				
			||||||
Bundle-Vendor: MINRES Technologies GmbH
 | 
					Bundle-Vendor: MINRES Technologies GmbH
 | 
				
			||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
					Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
				
			||||||
Import-Package: org.osgi.framework;version="1.3.0"
 | 
					Import-Package: org.osgi.framework;version="1.3.0"
 | 
				
			||||||
Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0",
 | 
					Require-Bundle: com.minres.scviewer.database,
 | 
				
			||||||
 org.codehaus.groovy;bundle-version="1.8.6",
 | 
					 org.codehaus.groovy;bundle-version="2.5.8",
 | 
				
			||||||
 org.eclipse.equinox.util;bundle-version="1.0.500",
 | 
					 org.eclipse.equinox.util;bundle-version="1.0.500",
 | 
				
			||||||
 org.eclipse.equinox.ds;bundle-version="1.4.200",
 | 
					 org.eclipse.equinox.ds;bundle-version="1.4.200",
 | 
				
			||||||
 org.eclipse.osgi.services;bundle-version="3.4.0",
 | 
					 org.eclipse.osgi.services;bundle-version="3.4.0",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
						xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
				
			||||||
	<modelVersion>4.0.0</modelVersion>
 | 
						<modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
	<artifactId>com.minres.scviewer.database.text</artifactId>
 | 
						<artifactId>com.minres.scviewer.database.text</artifactId>
 | 
				
			||||||
	<version>2.0.0-SNAPSHOT</version>
 | 
						<version>2.0.1-SNAPSHOT</version>
 | 
				
			||||||
	<parent>
 | 
						<parent>
 | 
				
			||||||
		<groupId>com.minres.scviewer</groupId>
 | 
							<groupId>com.minres.scviewer</groupId>
 | 
				
			||||||
		<artifactId>com.minres.scviewer.parent</artifactId>
 | 
							<artifactId>com.minres.scviewer.parent</artifactId>
 | 
				
			||||||
@@ -15,10 +15,13 @@
 | 
				
			|||||||
		<plugins>
 | 
							<plugins>
 | 
				
			||||||
			<plugin>
 | 
								<plugin>
 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
				<artifactId>tycho-compiler-plugin</artifactId>
 | 
									<artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
        		<version>0.23.1</version>
 | 
									<version>3.8.0</version>
 | 
				
			||||||
				<configuration>
 | 
									<configuration>
 | 
				
			||||||
					<compilerId>groovy-eclipse-compiler</compilerId>
 | 
										<compilerId>groovy-eclipse-compiler</compilerId>
 | 
				
			||||||
 | 
								        <compilerArguments>
 | 
				
			||||||
 | 
								            <indy/><!-- optional; supported by batch 2.4.12-04+ -->
 | 
				
			||||||
 | 
								        </compilerArguments>
 | 
				
			||||||
					<!-- set verbose to be true if you want lots of uninteresting messages -->
 | 
										<!-- set verbose to be true if you want lots of uninteresting messages -->
 | 
				
			||||||
					<!-- <verbose>true</verbose> -->
 | 
										<!-- <verbose>true</verbose> -->
 | 
				
			||||||
					<source>1.7</source>
 | 
										<source>1.7</source>
 | 
				
			||||||
@@ -34,8 +37,6 @@
 | 
				
			|||||||
						<groupId>org.codehaus.groovy</groupId>
 | 
											<groupId>org.codehaus.groovy</groupId>
 | 
				
			||||||
						<artifactId>groovy-eclipse-batch</artifactId>
 | 
											<artifactId>groovy-eclipse-batch</artifactId>
 | 
				
			||||||
						<version>${groovy-eclipse-batch-version}</version>
 | 
											<version>${groovy-eclipse-batch-version}</version>
 | 
				
			||||||
						<!-- or choose a different compiler version -->
 | 
					 | 
				
			||||||
						<!-- <version>2.1.8-01</version> -->
 | 
					 | 
				
			||||||
					</dependency>
 | 
										</dependency>
 | 
				
			||||||
				</dependencies>
 | 
									</dependencies>
 | 
				
			||||||
			</plugin>
 | 
								</plugin>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,7 @@ import com.minres.scviewer.database.IWaveform
 | 
				
			|||||||
import com.minres.scviewer.database.IWaveformDb
 | 
					import com.minres.scviewer.database.IWaveformDb
 | 
				
			||||||
import com.minres.scviewer.database.IWaveformDbLoader
 | 
					import com.minres.scviewer.database.IWaveformDbLoader
 | 
				
			||||||
import com.minres.scviewer.database.RelationType
 | 
					import com.minres.scviewer.database.RelationType
 | 
				
			||||||
 | 
					import com.minres.scviewer.database.DataType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class TextDbLoader implements IWaveformDbLoader{
 | 
					public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -80,14 +81,21 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
				.allocateStartSize(64*1024*1024)
 | 
									.allocateStartSize(64*1024*1024)
 | 
				
			||||||
				.allocateIncrement(64*1024*1024)
 | 
									.allocateIncrement(64*1024*1024)
 | 
				
			||||||
				.make()
 | 
									.make()
 | 
				
			||||||
 | 
									// NPE here --->
 | 
				
			||||||
				parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
 | 
									parseInput(gzipped?new GZIPInputStream(new FileInputStream(file)):new FileInputStream(file))
 | 
				
			||||||
				calculateConcurrencyIndicees()
 | 
									calculateConcurrencyIndicees()
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
							} catch (IndexOutOfBoundsException e) {
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
 | 
							} catch (NumberFormatException e) {
 | 
				
			||||||
 | 
								return false
 | 
				
			||||||
		} catch(EOFException e) {
 | 
							} catch(EOFException e) {
 | 
				
			||||||
			return true;
 | 
								return true;
 | 
				
			||||||
		} catch(Exception e) {
 | 
							} catch(Exception e) {
 | 
				
			||||||
			e.printStackTrace()
 | 
								System.out.println("---->>> Exception "+e.toString()+" caught while loading database");
 | 
				
			||||||
 | 
								//System.out.println("---->>> Exception "+e.toString()+" caught while loading database. StackTrace following... ");
 | 
				
			||||||
 | 
								//e.printStackTrace()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -113,7 +121,7 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
		} catch (IOException e) {
 | 
							} catch (IOException e) {
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		} finally {
 | 
							} finally {
 | 
				
			||||||
			is.close()
 | 
								if(is!=null) is.close()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -126,7 +134,9 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
			case "ms":return 1000000000000L
 | 
								case "ms":return 1000000000000L
 | 
				
			||||||
			case "s": return 1000000000000000L
 | 
								case "s": return 1000000000000000L
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							return "fs"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	private def parseInput(InputStream inputStream){
 | 
						private def parseInput(InputStream inputStream){
 | 
				
			||||||
		def streamsById = [:]
 | 
							def streamsById = [:]
 | 
				
			||||||
		def generatorsById = [:]
 | 
							def generatorsById = [:]
 | 
				
			||||||
@@ -138,7 +148,7 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
		BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
 | 
							BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
 | 
				
			||||||
		long lineCnt=0;
 | 
							long lineCnt=0;
 | 
				
			||||||
		reader.eachLine { line ->
 | 
							reader.eachLine { line ->
 | 
				
			||||||
			def tokens = line.split(/\s+/)
 | 
								def tokens = line.split(/\s+/) as ArrayList
 | 
				
			||||||
			switch(tokens[0]){
 | 
								switch(tokens[0]){
 | 
				
			||||||
				case "scv_tr_stream":
 | 
									case "scv_tr_stream":
 | 
				
			||||||
				case "scv_tr_generator":
 | 
									case "scv_tr_generator":
 | 
				
			||||||
@@ -185,7 +195,10 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
					break
 | 
										break
 | 
				
			||||||
				case "tx_record_attribute"://matcher = line =~ /^tx_record_attribute\s+(\d+)\s+"([^"]+)"\s+(\S+)\s*=\s*(.+)$/
 | 
									case "tx_record_attribute"://matcher = line =~ /^tx_record_attribute\s+(\d+)\s+"([^"]+)"\s+(\S+)\s*=\s*(.+)$/
 | 
				
			||||||
					def id = Integer.parseInt(tokens[1])
 | 
										def id = Integer.parseInt(tokens[1])
 | 
				
			||||||
					transactionsById[id].attributes<<new TxAttribute(tokens[2][1..-2], DataType.valueOf(tokens[3]), AssociationType.RECORD, tokens[5..-1].join(' '))
 | 
										def name = tokens[2][1..-2]
 | 
				
			||||||
 | 
										def type = tokens[3] as DataType
 | 
				
			||||||
 | 
										def remaining = tokens.size()>5?tokens[5..-1].join(' '):""
 | 
				
			||||||
 | 
										transactionsById[id].attributes<<new TxAttribute(name, type, AssociationType.RECORD, remaining)
 | 
				
			||||||
					break
 | 
										break
 | 
				
			||||||
				case "a"://matcher = line =~ /^a\s+(.+)$/
 | 
									case "a"://matcher = line =~ /^a\s+(.+)$/
 | 
				
			||||||
					if(endTransaction){
 | 
										if(endTransaction){
 | 
				
			||||||
@@ -213,6 +226,26 @@ public class TextDbLoader implements IWaveformDbLoader{
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private def toDataType(String str){
 | 
				
			||||||
 | 
							switch (str)
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
								case "BOOLEAN": return DataType.                       BOOLEAN                      
 | 
				
			||||||
 | 
								case "ENUMERATION": return DataType.                   ENUMERATION                  
 | 
				
			||||||
 | 
								case "INTEGER": return DataType.                       INTEGER                      
 | 
				
			||||||
 | 
								case "UNSIGNED": return DataType.                      UNSIGNED                     
 | 
				
			||||||
 | 
								case "FLOATING_POINT_NUMBER": return DataType.         FLOATING_POINT_NUMBER        
 | 
				
			||||||
 | 
								case "BIT_VECTOR": return DataType.                    BIT_VECTOR                   
 | 
				
			||||||
 | 
								case "LOGIC_VECTOR": return DataType.                  LOGIC_VECTOR                 
 | 
				
			||||||
 | 
								case "FIXED_POINT_INTEGER": return DataType.           FIXED_POINT_INTEGER          
 | 
				
			||||||
 | 
								case "UNSIGNED_FIXED_POINT_INTEGER": return DataType.  UNSIGNED_FIXED_POINT_INTEGER 
 | 
				
			||||||
 | 
								case "RECORD": return DataType.                        RECORD                       
 | 
				
			||||||
 | 
								case "POINTER": return DataType.                       POINTER                      
 | 
				
			||||||
 | 
								case "ARRAY": return DataType.                         ARRAY                        
 | 
				
			||||||
 | 
								case "STRING": return DataType.                        STRING
 | 
				
			||||||
 | 
								default: return DataType.INTEGER
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	private def calculateConcurrencyIndicees(){
 | 
						private def calculateConcurrencyIndicees(){
 | 
				
			||||||
		streams.each{ TxStream  stream -> stream.getMaxConcurrency() }
 | 
							streams.each{ TxStream  stream -> stream.getMaxConcurrency() }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 | 
				
			|||||||
Bundle-ManifestVersion: 2
 | 
					Bundle-ManifestVersion: 2
 | 
				
			||||||
Bundle-Name: SWT widget
 | 
					Bundle-Name: SWT widget
 | 
				
			||||||
Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
 | 
					Bundle-SymbolicName: com.minres.scviewer.database.ui.swt
 | 
				
			||||||
Bundle-Version: 2.0.0.qualifier
 | 
					Bundle-Version: 2.0.2.qualifier
 | 
				
			||||||
Bundle-Vendor: MINRES Technologies GmbH
 | 
					Bundle-Vendor: MINRES Technologies GmbH
 | 
				
			||||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
					Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
				
			||||||
Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
 | 
					Require-Bundle: org.eclipse.swt;bundle-version="3.103.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,4 +8,5 @@
 | 
				
			|||||||
  	<version>2.0.0-SNAPSHOT</version>
 | 
					  	<version>2.0.0-SNAPSHOT</version>
 | 
				
			||||||
  	<relativePath>../com.minres.scviewer.parent</relativePath>
 | 
					  	<relativePath>../com.minres.scviewer.parent</relativePath>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					  <version>2.0.2-SNAPSHOT</version>
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
@@ -46,6 +46,8 @@ public class ArrowPainter implements IPainter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	private RelationType highlightType;
 | 
						private RelationType highlightType;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private long selectionOffset;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	long scaleFactor;
 | 
						long scaleFactor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	boolean deferredUpdate;
 | 
						boolean deferredUpdate;
 | 
				
			||||||
@@ -87,8 +89,9 @@ public class ArrowPainter implements IPainter {
 | 
				
			|||||||
			deferredUpdate = true;
 | 
								deferredUpdate = true;
 | 
				
			||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							selectionOffset = waveCanvas.getXOffset();
 | 
				
			||||||
		int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
 | 
							int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
 | 
				
			||||||
		txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor),
 | 
							txRectangle = new Rectangle((int) (tx.getBeginTime() / scaleFactor-waveCanvas.getXOffset()),
 | 
				
			||||||
				waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * tx.getConcurrencyIndex(),
 | 
									waveCanvas.rulerHeight + painter.getVerticalOffset() + laneHeight * tx.getConcurrencyIndex(),
 | 
				
			||||||
				(int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight);
 | 
									(int) ((tx.getEndTime() - tx.getBeginTime()) / scaleFactor), laneHeight);
 | 
				
			||||||
		deriveGeom(tx.getIncomingRelations(), iRect, false);
 | 
							deriveGeom(tx.getIncomingRelations(), iRect, false);
 | 
				
			||||||
@@ -102,7 +105,7 @@ public class ArrowPainter implements IPainter {
 | 
				
			|||||||
				ITxStream<?> stream = otherTx.getStream();
 | 
									ITxStream<?> stream = otherTx.getStream();
 | 
				
			||||||
				IWaveformPainter painter = waveCanvas.wave2painterMap.get(stream);
 | 
									IWaveformPainter painter = waveCanvas.wave2painterMap.get(stream);
 | 
				
			||||||
				int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
 | 
									int laneHeight = painter.getHeight() / stream.getMaxConcurrency();
 | 
				
			||||||
				Rectangle bb = new Rectangle((int) (otherTx.getBeginTime() / scaleFactor),
 | 
									Rectangle bb = new Rectangle((int) (otherTx.getBeginTime() / scaleFactor-waveCanvas.getXOffset()),
 | 
				
			||||||
						waveCanvas.rulerHeight + painter.getVerticalOffset()
 | 
											waveCanvas.rulerHeight + painter.getVerticalOffset()
 | 
				
			||||||
								+ laneHeight * otherTx.getConcurrencyIndex(),
 | 
													+ laneHeight * otherTx.getConcurrencyIndex(),
 | 
				
			||||||
						(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), laneHeight);
 | 
											(int) ((otherTx.getEndTime() - otherTx.getBeginTime()) / scaleFactor), laneHeight);
 | 
				
			||||||
@@ -120,14 +123,19 @@ public class ArrowPainter implements IPainter {
 | 
				
			|||||||
			scaleFactor = waveCanvas.getScaleFactor();
 | 
								scaleFactor = waveCanvas.getScaleFactor();
 | 
				
			||||||
			calculateGeometries();
 | 
								calculateGeometries();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if(txRectangle == null) return;
 | 
				
			||||||
 | 
							int correctionValue = (int)(selectionOffset - waveCanvas.getXOffset());
 | 
				
			||||||
 | 
							Rectangle correctedTargetRectangle = new Rectangle(txRectangle.x+correctionValue, txRectangle.y, txRectangle.width, txRectangle.height);
 | 
				
			||||||
		for (LinkEntry entry : iRect) {
 | 
							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(gc, highlightType.equals(entry.relationType) ? highliteColor : fgColor,
 | 
				
			||||||
					entry.rectangle, txRectangle);
 | 
										correctedRectangle, correctedTargetRectangle);
 | 
				
			||||||
			drawArrow(gc, target);
 | 
								drawArrow(gc, target);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for (LinkEntry entry : oRect) {
 | 
							for (LinkEntry entry : oRect) {
 | 
				
			||||||
			Point target = drawPath(gc, highlightType.equals(entry.relationType) ? highliteColor : fgColor, txRectangle,
 | 
								Rectangle correctedRectangle = new Rectangle(entry.rectangle.x+correctionValue, entry.rectangle.y, entry.rectangle.width, entry.rectangle.height);
 | 
				
			||||||
					entry.rectangle);
 | 
								Point target = drawPath(gc, highlightType.equals(entry.relationType) ? highliteColor : fgColor, correctedTargetRectangle,
 | 
				
			||||||
 | 
										correctedRectangle);
 | 
				
			||||||
			drawArrow(gc, target);
 | 
								drawArrow(gc, target);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,11 @@ public class CursorPainter implements IPainter, ICursor {
 | 
				
			|||||||
	
 | 
						
 | 
				
			||||||
	public final int id;
 | 
						public final int id;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						/// maximum visible canvas position in canvas coordinates
 | 
				
			||||||
 | 
						int maxPosX;
 | 
				
			||||||
 | 
						/// maximum visible position in waveform coordinates
 | 
				
			||||||
 | 
						int maxValX;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * @param i 
 | 
						 * @param i 
 | 
				
			||||||
	 * @param txDisplay
 | 
						 * @param txDisplay
 | 
				
			||||||
@@ -56,23 +61,32 @@ public class CursorPainter implements IPainter, ICursor {
 | 
				
			|||||||
		this.isDragging = isDragging;
 | 
							this.isDragging = isDragging;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	public void paintArea(GC gc, Rectangle area) {			
 | 
						public void paintArea(GC gc, Rectangle area) {			
 | 
				
			||||||
		if(this.waveCanvas.painterList.size()>0){
 | 
							if(this.waveCanvas.painterList.size()>0){
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			long scaleFactor=waveCanvas.getScaleFactor();
 | 
								long scaleFactor=waveCanvas.getScaleFactor();
 | 
				
			||||||
 | 
								long beginPos = area.x;
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								maxPosX = area.x + area.width;
 | 
				
			||||||
 | 
								maxValX = maxPosX + (int)waveCanvas.getXOffset();
 | 
				
			||||||
 | 
						        
 | 
				
			||||||
 | 
								// x position of marker in pixels on canvas
 | 
				
			||||||
			int x = (int) (time/scaleFactor);
 | 
								int x = (int) (time/scaleFactor);
 | 
				
			||||||
 | 
								// distance of marker from the top of Canvas' painting area
 | 
				
			||||||
			int top = id<0?area.y:area.y+15;
 | 
								int top = id<0?area.y:area.y+15;
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			Color drawColor=waveCanvas.colors[id<0?WaveformColors.CURSOR.ordinal():WaveformColors.MARKER.ordinal()];
 | 
								Color drawColor=waveCanvas.colors[id<0?WaveformColors.CURSOR.ordinal():WaveformColors.MARKER.ordinal()];
 | 
				
			||||||
			Color dragColor = waveCanvas.colors[WaveformColors.CURSOR_DRAG.ordinal()];
 | 
								Color dragColor = waveCanvas.colors[WaveformColors.CURSOR_DRAG.ordinal()];
 | 
				
			||||||
			Color textColor=waveCanvas.colors[id<0?WaveformColors.CURSOR_TEXT.ordinal():WaveformColors.MARKER_TEXT.ordinal()];
 | 
								Color textColor=waveCanvas.colors[id<0?WaveformColors.CURSOR_TEXT.ordinal():WaveformColors.MARKER_TEXT.ordinal()];
 | 
				
			||||||
			if(x>=area.x && x<=(area.x+area.width)){
 | 
								if(x>=beginPos && x<=maxValX){
 | 
				
			||||||
				gc.setForeground(isDragging?dragColor:drawColor);
 | 
									gc.setForeground(isDragging?dragColor:drawColor);
 | 
				
			||||||
				gc.drawLine(x, top, x, area.y+area.height);
 | 
									gc.drawLine(x-(int)waveCanvas.getXOffset(), top, x-(int)waveCanvas.getXOffset(), area.y+area.height);
 | 
				
			||||||
				gc.setBackground(drawColor);
 | 
									gc.setBackground(drawColor);
 | 
				
			||||||
				gc.setForeground(textColor);
 | 
									gc.setForeground(textColor);
 | 
				
			||||||
				Double dTime=new Double(time);
 | 
									Double dTime=new Double(time);
 | 
				
			||||||
				gc.drawText((dTime/waveCanvas.getScaleFactorPow10())+waveCanvas.getUnitStr(), x+1, top);
 | 
									gc.drawText((dTime/waveCanvas.getScaleFactorPow10())+waveCanvas.getUnitStr(), x+1-(int)waveCanvas.getXOffset(), top);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}	
 | 
						}	
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -32,6 +32,7 @@ public class RulerPainter implements IPainter {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void paintArea(GC gc, Rectangle area) {
 | 
					    public void paintArea(GC gc, Rectangle area) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    	Color headerFgColor=waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
 | 
					    	Color headerFgColor=waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
 | 
				
			||||||
    	if(headerFgColor.isDisposed())
 | 
					    	if(headerFgColor.isDisposed())
 | 
				
			||||||
    		headerFgColor=SWTResourceManager.getColor(0,0,0);
 | 
					    		headerFgColor=SWTResourceManager.getColor(0,0,0);
 | 
				
			||||||
@@ -41,9 +42,11 @@ public class RulerPainter implements IPainter {
 | 
				
			|||||||
        String unit=waveCanvas.getUnitStr();
 | 
					        String unit=waveCanvas.getUnitStr();
 | 
				
			||||||
        int unitMultiplier=waveCanvas.getUnitMultiplier();
 | 
					        int unitMultiplier=waveCanvas.getUnitMultiplier();
 | 
				
			||||||
        long scaleFactor=waveCanvas.getScaleFactor();
 | 
					        long scaleFactor=waveCanvas.getScaleFactor();
 | 
				
			||||||
//        long zoomLevel = waveCanvas.getZoomLevel();
 | 
					
 | 
				
			||||||
        long start=area.x*scaleFactor;
 | 
					        long startPos=area.x*scaleFactor; 
 | 
				
			||||||
        long end=start+area.width*scaleFactor;
 | 
					        long startVal=startPos + waveCanvas.getXOffset()*scaleFactor;
 | 
				
			||||||
 | 
					        long endPos=startPos+area.width*scaleFactor;
 | 
				
			||||||
 | 
					        long endVal=startVal+area.width*scaleFactor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        long rulerTickMinor = rulerTickMinorC*scaleFactor;
 | 
					        long rulerTickMinor = rulerTickMinorC*scaleFactor;
 | 
				
			||||||
        long rulerTickMajor = rulerTickMajorC*scaleFactor;
 | 
					        long rulerTickMajor = rulerTickMajorC*scaleFactor;
 | 
				
			||||||
@@ -54,9 +57,9 @@ public class RulerPainter implements IPainter {
 | 
				
			|||||||
        int baselineY=waveCanvas.rulerHeight - 1;
 | 
					        int baselineY=waveCanvas.rulerHeight - 1;
 | 
				
			||||||
        int bottom=waveCanvas.rulerHeight - 2;
 | 
					        int bottom=waveCanvas.rulerHeight - 2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        long startMinorIncr = start;
 | 
					        long modulo = startVal % rulerTickMinor;
 | 
				
			||||||
        long modulo = start % rulerTickMinor;
 | 
					        long startMinorIncrPos = startPos+rulerTickMinor-modulo;
 | 
				
			||||||
        startMinorIncr+=rulerTickMinor-modulo;
 | 
					        long startMinorIncrVal = startVal+rulerTickMinor-modulo;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        gc.setBackground(waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
 | 
					        gc.setBackground(waveCanvas.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
 | 
				
			||||||
        gc.fillRectangle(new Rectangle(area.x, area.y, area.width, waveCanvas.rulerHeight));
 | 
					        gc.fillRectangle(new Rectangle(area.x, area.y, area.width, waveCanvas.rulerHeight));
 | 
				
			||||||
@@ -65,15 +68,18 @@ public class RulerPainter implements IPainter {
 | 
				
			|||||||
        gc.setForeground(headerFgColor);
 | 
					        gc.setForeground(headerFgColor);
 | 
				
			||||||
        gc.drawLine(area.x, area.y+bottom, area.x+area.width, area.y+bottom);
 | 
					        gc.drawLine(area.x, area.y+bottom, area.x+area.width, area.y+bottom);
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        for (long tick = startMinorIncr; tick < end; tick += rulerTickMinor) {
 | 
					        int x0_max = 0;
 | 
				
			||||||
            int x0 = (int) (tick/scaleFactor);
 | 
					        
 | 
				
			||||||
 | 
					        for (long pos = startMinorIncrPos, tick = startMinorIncrVal; pos < endPos; pos+= rulerTickMinor, tick += rulerTickMinor) {
 | 
				
			||||||
 | 
					            int x0_pos = (int) (pos/scaleFactor);
 | 
				
			||||||
 | 
					            long x0_val = tick/scaleFactor;
 | 
				
			||||||
 | 
					            x0_max = x0_pos;
 | 
				
			||||||
            if ((tick % rulerTickMajor) == 0) {
 | 
					            if ((tick % rulerTickMajor) == 0) {
 | 
				
			||||||
                gc.drawText(df.format(tick/scaleFactor*unitMultiplier)+unit, x0, area.y+textY);
 | 
					                gc.drawText(df.format(x0_val*unitMultiplier)+unit, x0_pos, area.y+textY);
 | 
				
			||||||
                gc.drawLine(x0, area.y+majorTickY, x0,area.y+ bottom);
 | 
					                gc.drawLine(x0_pos, area.y+majorTickY, x0_pos,area.y+ bottom);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                gc.drawLine(x0, area.y+minorTickY, x0, area.y+bottom);
 | 
					                gc.drawLine(x0_pos, area.y+minorTickY, x0_pos, area.y+bottom);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -68,16 +68,24 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
	int yOffsetT;
 | 
						int yOffsetT;
 | 
				
			||||||
	int yOffsetM;
 | 
						int yOffsetM;
 | 
				
			||||||
	int yOffsetB;
 | 
						int yOffsetB;
 | 
				
			||||||
	int maxX;
 | 
						/// maximum visible canvas position in canvas coordinates
 | 
				
			||||||
 | 
						int maxPosX;
 | 
				
			||||||
 | 
						/// maximum visible position in waveform coordinates
 | 
				
			||||||
 | 
						int maxValX;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public SignalPainter(WaveformCanvas txDisplay, boolean even, TrackEntry trackEntry) {
 | 
						public SignalPainter(WaveformCanvas txDisplay, boolean even, TrackEntry trackEntry) {
 | 
				
			||||||
		super(trackEntry, even);
 | 
							super(trackEntry, even);
 | 
				
			||||||
		this.waveCanvas = txDisplay;
 | 
							this.waveCanvas = txDisplay;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	private int getXEnd(long time) {
 | 
						private int getXValEnd(long time) {
 | 
				
			||||||
		long ltmp = time / this.waveCanvas.getScaleFactor();
 | 
							long ltmp = time / this.waveCanvas.getScaleFactor();
 | 
				
			||||||
		return ltmp > maxX ? maxX : (int) ltmp;
 | 
							return ltmp > maxValX ? maxValX : (int) ltmp;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private int getXPosEnd(long time) {
 | 
				
			||||||
 | 
							long ltmp = time / this.waveCanvas.getScaleFactor() - waveCanvas.getXOffset();
 | 
				
			||||||
 | 
							return ltmp > maxPosX ? maxPosX : (int) ltmp;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public void paintArea(GC gc, Rectangle area) {
 | 
						public void paintArea(GC gc, Rectangle area) {
 | 
				
			||||||
@@ -88,8 +96,13 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
			gc.setBackground(this.waveCanvas.colors[even ? WaveformColors.TRACK_BG_EVEN.ordinal() : WaveformColors.TRACK_BG_ODD.ordinal()]);
 | 
								gc.setBackground(this.waveCanvas.colors[even ? WaveformColors.TRACK_BG_EVEN.ordinal() : WaveformColors.TRACK_BG_ODD.ordinal()]);
 | 
				
			||||||
		gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
							gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
				
			||||||
		gc.fillRectangle(area);
 | 
							gc.fillRectangle(area);
 | 
				
			||||||
		long beginTime = area.x * this.waveCanvas.getScaleFactor();
 | 
					
 | 
				
			||||||
		long endTime = (area.x + area.width) * this.waveCanvas.getScaleFactor();
 | 
							long scaleFactor = this.waveCanvas.getScaleFactor();
 | 
				
			||||||
 | 
							long beginPos = area.x;
 | 
				
			||||||
 | 
							long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
 | 
				
			||||||
 | 
							long endPos = beginPos + area.width;
 | 
				
			||||||
 | 
					        long endTime = beginTime + area.width*scaleFactor;
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
 | 
							Entry<Long, ?> first = signal.getEvents().floorEntry(beginTime);
 | 
				
			||||||
		Entry<Long, ?> last = signal.getEvents().floorEntry(endTime);
 | 
							Entry<Long, ?> last = signal.getEvents().floorEntry(endTime);
 | 
				
			||||||
		if (first == null) {
 | 
							if (first == null) {
 | 
				
			||||||
@@ -105,14 +118,18 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
		NavigableMap<Long, ?> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true);
 | 
							NavigableMap<Long, ?> entries = signal.getEvents().subMap(first.getKey(), false, last.getKey(), true);
 | 
				
			||||||
		SignalChange left = new SignalChange(first);
 | 
							SignalChange left = new SignalChange(first);
 | 
				
			||||||
		SignalChange right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first);
 | 
							SignalChange right = new SignalChange(entries.size() > 0 ? entries.firstEntry() : first);
 | 
				
			||||||
		maxX = area.x + area.width;
 | 
							maxPosX = area.x + area.width;
 | 
				
			||||||
 | 
							maxValX = maxPosX + (int)waveCanvas.getXOffset();
 | 
				
			||||||
		yOffsetT = this.waveCanvas.getTrackHeight() / 5 + area.y;
 | 
							yOffsetT = this.waveCanvas.getTrackHeight() / 5 + area.y;
 | 
				
			||||||
		yOffsetM = this.waveCanvas.getTrackHeight() / 2 + area.y;
 | 
							yOffsetM = this.waveCanvas.getTrackHeight() / 2 + area.y;
 | 
				
			||||||
		yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
 | 
							yOffsetB = 4 * this.waveCanvas.getTrackHeight() / 5 + area.y;
 | 
				
			||||||
		int xBegin = Math.max(area.x, (int) (left.time / this.waveCanvas.getScaleFactor()));
 | 
							int xSigChangeBeginVal = Math.max(area.x + (int)waveCanvas.getXOffset(), (int) (left.time / this.waveCanvas.getScaleFactor()));
 | 
				
			||||||
		int xEnd = Math.max(area.x, getXEnd(right.time));
 | 
							int xSigChangeBeginPos = area.x;
 | 
				
			||||||
 | 
							int xSigChangeEndVal = Math.max(area.x + (int)waveCanvas.getXOffset(), getXValEnd(right.time));
 | 
				
			||||||
 | 
							int xSigChangeEndPos = Math.max(area.x, getXPosEnd(right.time));
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		boolean multiple = false;
 | 
							boolean multiple = false;
 | 
				
			||||||
		if (xEnd == xBegin) {
 | 
							if (xSigChangeEndPos == xSigChangeBeginPos) {
 | 
				
			||||||
			// this can trigger if
 | 
								// this can trigger if
 | 
				
			||||||
			// a) left == right
 | 
								// a) left == right
 | 
				
			||||||
			// b) left to close to right
 | 
								// b) left to close to right
 | 
				
			||||||
@@ -120,30 +137,31 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
				right.time = endTime;
 | 
									right.time = endTime;
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				multiple = true;
 | 
									multiple = true;
 | 
				
			||||||
				long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor();
 | 
									long eTime = (xSigChangeBeginVal + 1) * this.waveCanvas.getScaleFactor();
 | 
				
			||||||
				right.set(entries.floorEntry(eTime), endTime);
 | 
									right.set(entries.floorEntry(eTime), endTime);
 | 
				
			||||||
				right.time = eTime;
 | 
									right.time = eTime;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			xEnd = getXEnd(right.time);
 | 
								xSigChangeEndPos = getXPosEnd(right.time);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		SignalStencil stencil = getStencil(gc, left, entries);
 | 
							SignalStencil stencil = getStencil(gc, left, entries);
 | 
				
			||||||
		do {
 | 
							do {
 | 
				
			||||||
			stencil.draw(gc, area, left.value, right.value, xBegin, xEnd, multiple);
 | 
								stencil.draw(gc, area, left.value, right.value, xSigChangeBeginPos, xSigChangeEndPos, multiple);
 | 
				
			||||||
			if (right.time >= endTime)
 | 
								if (right.time >= endTime)
 | 
				
			||||||
				break;
 | 
									break;
 | 
				
			||||||
			left.assign(right);
 | 
								left.assign(right);
 | 
				
			||||||
			xBegin = xEnd;
 | 
								xSigChangeBeginPos = xSigChangeEndPos;
 | 
				
			||||||
			right.set(entries.higherEntry(left.time), endTime);
 | 
								right.set(entries.higherEntry(left.time), endTime);
 | 
				
			||||||
			xEnd = getXEnd(right.time);
 | 
								xSigChangeEndPos = getXPosEnd(right.time);
 | 
				
			||||||
			multiple = false;
 | 
								multiple = false;
 | 
				
			||||||
			if (xEnd == xBegin) {
 | 
								if (xSigChangeEndPos == xSigChangeBeginPos) {
 | 
				
			||||||
				multiple = true;
 | 
									multiple = true;
 | 
				
			||||||
				long eTime = (xBegin + 1) * this.waveCanvas.getScaleFactor();
 | 
									long eTime = (xSigChangeBeginPos + 1) * this.waveCanvas.getScaleFactor();
 | 
				
			||||||
				Entry<Long, ?> entry = entries.floorEntry(eTime);
 | 
									Entry<Long, ?> entry = entries.floorEntry(eTime);
 | 
				
			||||||
				if(entry!=null && entry.getKey()> right.time)
 | 
									if(entry!=null && entry.getKey()> right.time)
 | 
				
			||||||
					right.set(entry, endTime);
 | 
										right.set(entry, endTime);
 | 
				
			||||||
				xEnd = getXEnd(eTime);
 | 
									xSigChangeEndPos = getXPosEnd(eTime);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		} while (left.time < endTime);
 | 
							} while (left.time < endTime);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -273,14 +291,14 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
			int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
								int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
				
			||||||
			int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
								int yOffsetRight = (int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
				
			||||||
			if(continous) {
 | 
								if(continous) {
 | 
				
			||||||
				if (xEnd > maxX) {
 | 
									if (xEnd > maxPosX) {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxX, yOffsetB-yOffsetRight);
 | 
										gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
 | 
										gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				if (xEnd > maxX) {
 | 
									if (xEnd > maxPosX) {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxX, yOffsetB-yOffsetLeft);
 | 
										gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
 | 
										gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
 | 
				
			||||||
					if(yOffsetRight!=yOffsetLeft) {
 | 
										if(yOffsetRight!=yOffsetLeft) {
 | 
				
			||||||
@@ -316,8 +334,8 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
				default:
 | 
									default:
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				gc.setForeground(color);
 | 
									gc.setForeground(color);
 | 
				
			||||||
				if (xEnd > maxX) {
 | 
									if (xEnd > maxPosX) {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffset, maxX, yOffset);
 | 
										gc.drawLine(xBegin, yOffset, maxPosX, yOffset);
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					gc.drawLine(xBegin, yOffset, xEnd, yOffset);
 | 
										gc.drawLine(xBegin, yOffset, xEnd, yOffset);
 | 
				
			||||||
					int yNext = yOffsetM;
 | 
										int yNext = yOffsetM;
 | 
				
			||||||
@@ -398,14 +416,14 @@ public class SignalPainter extends TrackPainter {
 | 
				
			|||||||
				int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
									int yOffsetLeft = (int) ((leftVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
				
			||||||
				int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
									int yOffsetRight = Double.isNaN(rightVal)?yOffsetLeft:(int) ((rightVal-minVal) / range * (yOffsetB-yOffsetT));
 | 
				
			||||||
				if(continous) {
 | 
									if(continous) {
 | 
				
			||||||
					if (xEnd > maxX) {
 | 
										if (xEnd > maxPosX) {
 | 
				
			||||||
						gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxX, yOffsetB-yOffsetRight);
 | 
											gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetRight);
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
 | 
											gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetRight);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					if (xEnd > maxX) {
 | 
										if (xEnd > maxPosX) {
 | 
				
			||||||
						gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxX, yOffsetB-yOffsetLeft);
 | 
											gc.drawLine(xBegin, yOffsetB-yOffsetLeft, maxPosX, yOffsetB-yOffsetLeft);
 | 
				
			||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
 | 
											gc.drawLine(xBegin, yOffsetB-yOffsetLeft, xEnd, yOffsetB-yOffsetLeft);
 | 
				
			||||||
						if(yOffsetRight!=yOffsetLeft) {
 | 
											if(yOffsetRight!=yOffsetLeft) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,64 +45,93 @@ public class StreamPainter extends TrackPainter{
 | 
				
			|||||||
		this.seenTx=new TreeSet<ITx>();
 | 
							this.seenTx=new TreeSet<ITx>();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
						 * convert java.awt.Color to org.eclipse.swt.graphics.Color 
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						static org.eclipse.swt.graphics.Color toSwtColor( GC gc, java.awt.Color awtColor ){
 | 
				
			||||||
 | 
							return new org.eclipse.swt.graphics.Color( gc.getDevice(), awtColor.getRed(), awtColor.getGreen(), awtColor.getBlue() );
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						static org.eclipse.swt.graphics.Color[] toSwtColors( GC gc, java.awt.Color[] awtColors ){
 | 
				
			||||||
 | 
							org.eclipse.swt.graphics.Color[] swtColors = new org.eclipse.swt.graphics.Color[awtColors.length];
 | 
				
			||||||
 | 
							for( int i=0; i<awtColors.length; i++ )
 | 
				
			||||||
 | 
								swtColors[i] = toSwtColor( gc, awtColors[i] );
 | 
				
			||||||
 | 
							return swtColors;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@SuppressWarnings("unchecked")
 | 
						@SuppressWarnings("unchecked")
 | 
				
			||||||
	public void paintArea(GC gc, Rectangle area) {
 | 
						public void paintArea(GC gc, Rectangle area) {
 | 
				
			||||||
		if(stream.getEvents().size()==0) return;
 | 
							if(stream.getEvents().size()==0) return;
 | 
				
			||||||
		int trackHeight=trackEntry.height/stream.getMaxConcurrency();
 | 
							int trackHeight=trackEntry.height/stream.getMaxConcurrency();
 | 
				
			||||||
		txBase=trackHeight/5;
 | 
							txBase=trackHeight/5;
 | 
				
			||||||
		txHeight=trackHeight*3/5;
 | 
							txHeight=trackHeight*3/5;
 | 
				
			||||||
		if(trackEntry.selected)
 | 
							if(trackEntry.selected) {
 | 
				
			||||||
			gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
 | 
								gc.setBackground(this.waveCanvas.colors[WaveformColors.TRACK_BG_HIGHLITE.ordinal()]);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			gc.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]);
 | 
								gc.setBackground(this.waveCanvas.colors[even?WaveformColors.TRACK_BG_EVEN.ordinal():WaveformColors.TRACK_BG_ODD.ordinal()]);
 | 
				
			||||||
		gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
							gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
				
			||||||
		gc.fillRectangle(area);
 | 
							gc.fillRectangle(area);
 | 
				
			||||||
		Entry<Long, ?> firstTx=stream.getEvents().floorEntry(area.x*waveCanvas.getScaleFactor());
 | 
							
 | 
				
			||||||
		Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry((area.x+area.width)*waveCanvas.getScaleFactor());
 | 
							long scaleFactor = this.waveCanvas.getScaleFactor();
 | 
				
			||||||
 | 
							long beginPos = area.x;
 | 
				
			||||||
 | 
							long beginTime = (beginPos + waveCanvas.getXOffset())*scaleFactor;
 | 
				
			||||||
 | 
							//long endPos = beginPos + area.width;
 | 
				
			||||||
 | 
					        long endTime = beginTime + area.width*scaleFactor;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							Entry<Long, ?> firstTx=stream.getEvents().floorEntry(beginTime);
 | 
				
			||||||
 | 
							Entry<Long, ?> lastTx=stream.getEvents().ceilingEntry(endTime);
 | 
				
			||||||
		if(firstTx==null) firstTx = stream.getEvents().firstEntry();
 | 
							if(firstTx==null) firstTx = stream.getEvents().firstEntry();
 | 
				
			||||||
		if(lastTx==null) lastTx=stream.getEvents().lastEntry();
 | 
							if(lastTx==null) lastTx=stream.getEvents().lastEntry();
 | 
				
			||||||
        gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
					        gc.setFillRule(SWT.FILL_EVEN_ODD);
 | 
				
			||||||
        gc.setLineStyle(SWT.LINE_SOLID);
 | 
					        gc.setLineStyle(SWT.LINE_SOLID);
 | 
				
			||||||
        gc.setLineWidth(1);
 | 
					        gc.setLineWidth(1);
 | 
				
			||||||
        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
 | 
					        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
 | 
				
			||||||
        for(int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
 | 
					        
 | 
				
			||||||
 | 
					        for( int y1=area.y+trackHeight/2; y1<area.y+trackEntry.height; y1+=trackHeight)
 | 
				
			||||||
        	gc.drawLine(area.x, y1, area.x+area.width, y1);
 | 
					        	gc.drawLine(area.x, y1, area.x+area.width, y1);
 | 
				
			||||||
		if(firstTx==lastTx)
 | 
							if(firstTx==lastTx) {
 | 
				
			||||||
			for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)firstTx.getValue())
 | 
								for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)firstTx.getValue())
 | 
				
			||||||
				drawTx(gc, area, txEvent.getTransaction());					
 | 
									drawTx(gc, area, txEvent.getTransaction(), false);
 | 
				
			||||||
		else{
 | 
							}else{
 | 
				
			||||||
			seenTx.clear();
 | 
								seenTx.clear();
 | 
				
			||||||
			NavigableMap<Long,?> entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true);
 | 
								NavigableMap<Long,?> entries = stream.getEvents().subMap(firstTx.getKey(), true, lastTx.getKey(), true);
 | 
				
			||||||
			boolean highlighed=false;
 | 
								boolean highlighed=false;
 | 
				
			||||||
	        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
 | 
						        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE.ordinal()]);
 | 
				
			||||||
	        gc.setBackground(this.waveCanvas.colors[WaveformColors.TX_BG.ordinal()]);
 | 
						        
 | 
				
			||||||
			for(Entry<Long, ?> entry: entries.entrySet())
 | 
						        for(Entry<Long, ?> entry: entries.entrySet())
 | 
				
			||||||
				for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)entry.getValue()){
 | 
									for(ITxEvent txEvent:(Collection<?  extends ITxEvent>)entry.getValue()){
 | 
				
			||||||
					if(txEvent.getType()==ITxEvent.Type.BEGIN)
 | 
										if(txEvent.getType()==ITxEvent.Type.BEGIN)
 | 
				
			||||||
						seenTx.add(txEvent.getTransaction());
 | 
											seenTx.add(txEvent.getTransaction());
 | 
				
			||||||
					if(txEvent.getType()==ITxEvent.Type.END){
 | 
										if(txEvent.getType()==ITxEvent.Type.END){
 | 
				
			||||||
						ITx tx = txEvent.getTransaction();
 | 
											ITx tx = txEvent.getTransaction();
 | 
				
			||||||
						highlighed|=waveCanvas.currentSelection!=null && waveCanvas.currentSelection.equals(tx);
 | 
											highlighed|=waveCanvas.currentSelection!=null && waveCanvas.currentSelection.equals(tx);
 | 
				
			||||||
						drawTx(gc, area, tx);
 | 
											drawTx(gc, area, tx, false);
 | 
				
			||||||
						seenTx.remove(tx);
 | 
											seenTx.remove(tx);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			for(ITx tx:seenTx){
 | 
								for(ITx tx:seenTx){
 | 
				
			||||||
				drawTx(gc, area, tx);
 | 
									drawTx(gc, area, tx, false);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if(highlighed){
 | 
								if(highlighed){
 | 
				
			||||||
		        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE_HIGHLITE.ordinal()]);
 | 
							        gc.setForeground(this.waveCanvas.colors[WaveformColors.LINE_HIGHLITE.ordinal()]);
 | 
				
			||||||
		        gc.setBackground(this.waveCanvas.colors[WaveformColors.TX_BG_HIGHLITE.ordinal()]);
 | 
							        drawTx(gc, area, waveCanvas.currentSelection, true);
 | 
				
			||||||
				drawTx(gc, area, waveCanvas.currentSelection);
 | 
					 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	protected void drawTx(GC gc, Rectangle area, ITx tx) {
 | 
						protected void drawTx(GC gc, 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] ) );
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
		int offset = tx.getConcurrencyIndex()*this.waveCanvas.getTrackHeight();
 | 
							int offset = tx.getConcurrencyIndex()*this.waveCanvas.getTrackHeight();
 | 
				
			||||||
		Rectangle bb = new Rectangle(
 | 
							Rectangle bb = new Rectangle(
 | 
				
			||||||
				(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()), area.y+offset+txBase,
 | 
									(int)(tx.getBeginTime()/this.waveCanvas.getScaleFactor()-waveCanvas.getXOffset()), area.y+offset+txBase,
 | 
				
			||||||
				(int)((tx.getEndTime()-tx.getBeginTime())/this.waveCanvas.getScaleFactor()), txHeight);
 | 
									(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.x+bb.width<area.x || bb.x>area.x+area.width) return;
 | 
				
			||||||
		if(bb.width==0){
 | 
							if(bb.width==0){
 | 
				
			||||||
			gc.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height);
 | 
								gc.drawLine(bb.x, bb.y, bb.x, bb.y+bb.height);
 | 
				
			||||||
@@ -110,7 +139,6 @@ public class StreamPainter extends TrackPainter{
 | 
				
			|||||||
			gc.fillRectangle(bb);
 | 
								gc.fillRectangle(bb);
 | 
				
			||||||
			gc.drawRectangle(bb);
 | 
								gc.drawRectangle(bb);
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			// adjusting drawing width to circumvent issues in canvas algos
 | 
					 | 
				
			||||||
			if(bb.x < area.x) {
 | 
								if(bb.x < area.x) {
 | 
				
			||||||
				bb.width = bb.width-(area.x-bb.x)+5;
 | 
									bb.width = bb.width-(area.x-bb.x)+5;
 | 
				
			||||||
				bb.x=area.x-5;
 | 
									bb.x=area.x-5;
 | 
				
			||||||
@@ -121,7 +149,7 @@ public class StreamPainter extends TrackPainter{
 | 
				
			|||||||
				bb_x2=area_x2+5;
 | 
									bb_x2=area_x2+5;
 | 
				
			||||||
				bb.width= bb_x2-bb.x;
 | 
									bb.width= bb_x2-bb.x;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		    gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
 | 
								gc.fillRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
 | 
				
			||||||
		    gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
 | 
							    gc.drawRoundRectangle(bb.x, bb.y, bb.width, bb.height, 5, 5);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,7 @@ import com.minres.scviewer.database.ui.IWaveformViewer;
 | 
				
			|||||||
import com.minres.scviewer.database.ui.TrackEntry;
 | 
					import com.minres.scviewer.database.ui.TrackEntry;
 | 
				
			||||||
import com.minres.scviewer.database.ui.WaveformColors;
 | 
					import com.minres.scviewer.database.ui.WaveformColors;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class WaveformCanvas extends Canvas {
 | 
					public class WaveformCanvas extends Canvas{
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
    Color[] colors = new Color[WaveformColors.values().length];
 | 
					    Color[] colors = new Color[WaveformColors.values().length];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -84,13 +84,13 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
     * Constructor for ScrollableCanvas.
 | 
					     * Constructor for ScrollableCanvas.
 | 
				
			||||||
     * 
 | 
					     * 
 | 
				
			||||||
     * @param parent
 | 
					     * @param parent
 | 
				
			||||||
     *            the parent of this control.
 | 
					     *            the parent of this control.super(parent, style | SWT.DOUBLE_BUFFERED | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL);
 | 
				
			||||||
     * @param style
 | 
					     * @param style
 | 
				
			||||||
     *            the style of this control.
 | 
					     *            the style of this control.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public WaveformCanvas(final Composite parent, int style) {
 | 
					    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.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL);
 | 
				
			||||||
        addControlListener(new ControlAdapter() { /* resize listener. */
 | 
					    	addControlListener(new ControlAdapter() { /* resize listener. */
 | 
				
			||||||
            public void controlResized(ControlEvent event) {
 | 
					            public void controlResized(ControlEvent event) {
 | 
				
			||||||
                syncScrollBars();
 | 
					                syncScrollBars();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -150,6 +150,10 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    public long getXOffset() {
 | 
				
			||||||
 | 
					    	return -origin.x;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
	public void addCursoPainter(CursorPainter cursorPainter){
 | 
						public void addCursoPainter(CursorPainter cursorPainter){
 | 
				
			||||||
		painterList.add(cursorPainter);
 | 
							painterList.add(cursorPainter);
 | 
				
			||||||
		cursorPainters.add(cursorPainter);
 | 
							cursorPainters.add(cursorPainter);
 | 
				
			||||||
@@ -243,10 +247,11 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
    		long xoffs=xc+origin.x; // cursor offset relative to left border
 | 
					    		long xoffs=xc+origin.x; // cursor offset relative to left border
 | 
				
			||||||
    		long xcn=tc/scaleFactor; // new total x-offset
 | 
					    		long xcn=tc/scaleFactor; // new total x-offset
 | 
				
			||||||
    		long originX=xcn-xoffs;
 | 
					    		long originX=xcn-xoffs;
 | 
				
			||||||
    		if(originX>0)
 | 
					    		if(originX>0) {
 | 
				
			||||||
    			origin.x=(int) -originX; // new cursor time offset relative to left border
 | 
					    			origin.x=(int) -originX; // new cursor time offset relative to left border
 | 
				
			||||||
    		else
 | 
					    		}else {
 | 
				
			||||||
    			origin.x=0;
 | 
					    			origin.x=0;
 | 
				
			||||||
 | 
					    		}
 | 
				
			||||||
    		syncScrollBars();
 | 
					    		syncScrollBars();
 | 
				
			||||||
    		arrowPainter.setTx(tx);    		
 | 
					    		arrowPainter.setTx(tx);    		
 | 
				
			||||||
    		redraw();
 | 
					    		redraw();
 | 
				
			||||||
@@ -354,7 +359,7 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        int height = trackAreaPainter.getHeight(); // incl. Ruler
 | 
					        int height = trackAreaPainter.getHeight(); // incl. Ruler
 | 
				
			||||||
        int width = (int) (maxTime / scaleFactor);
 | 
					        long width = maxTime / scaleFactor;
 | 
				
			||||||
        Rectangle clientArea=getClientArea();
 | 
					        Rectangle clientArea=getClientArea();
 | 
				
			||||||
        ScrollBar horizontal = getHorizontalBar();
 | 
					        ScrollBar horizontal = getHorizontalBar();
 | 
				
			||||||
        horizontal.setIncrement((int) (getClientArea().width / 100));
 | 
					        horizontal.setIncrement((int) (getClientArea().width / 100));
 | 
				
			||||||
@@ -362,10 +367,11 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
        int clientWidthw = clientArea.width;
 | 
					        int clientWidthw = clientArea.width;
 | 
				
			||||||
        if (width > clientWidthw) { /* image is wider than client area */
 | 
					        if (width > clientWidthw) { /* image is wider than client area */
 | 
				
			||||||
        	horizontal.setMinimum(0);
 | 
					        	horizontal.setMinimum(0);
 | 
				
			||||||
            horizontal.setMaximum(width);
 | 
					            horizontal.setMaximum((int)width);
 | 
				
			||||||
            horizontal.setEnabled(true);
 | 
					            horizontal.setEnabled(true);
 | 
				
			||||||
            if (((int) -origin.x) > horizontal.getMaximum() - clientWidthw)
 | 
					            if (((int) -origin.x) > horizontal.getMaximum() - clientWidthw) {
 | 
				
			||||||
                origin.x = -horizontal.getMaximum() + clientWidthw;
 | 
					                origin.x = -horizontal.getMaximum() + clientWidthw;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        } else { /* image is narrower than client area */
 | 
					        } else { /* image is narrower than client area */
 | 
				
			||||||
            horizontal.setEnabled(false);
 | 
					            horizontal.setEnabled(false);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -380,8 +386,9 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
            vertical.setMinimum(0);
 | 
					            vertical.setMinimum(0);
 | 
				
			||||||
            vertical.setMaximum(height);
 | 
					            vertical.setMaximum(height);
 | 
				
			||||||
            vertical.setEnabled(true);
 | 
					            vertical.setEnabled(true);
 | 
				
			||||||
            if (((int) -origin.y) > vertical.getMaximum() - clientHeighth)
 | 
					            if (((int) -origin.y) > vertical.getMaximum() - clientHeighth) {
 | 
				
			||||||
                origin.y = -vertical.getMaximum() + clientHeighth;
 | 
					                origin.y = -vertical.getMaximum() + clientHeighth;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        } else { /* image is less higher than client area */
 | 
					        } else { /* image is less higher than client area */
 | 
				
			||||||
            vertical.setMaximum((int) (clientHeighth));
 | 
					            vertical.setMaximum((int) (clientHeighth));
 | 
				
			||||||
            vertical.setEnabled(false);
 | 
					            vertical.setEnabled(false);
 | 
				
			||||||
@@ -396,12 +403,13 @@ public class WaveformCanvas extends Canvas {
 | 
				
			|||||||
    /* Paint function */
 | 
					    /* Paint function */
 | 
				
			||||||
    private void paint(GC gc) {
 | 
					    private void paint(GC gc) {
 | 
				
			||||||
        Rectangle clientRect = getClientArea(); /* Canvas' painting area */
 | 
					        Rectangle clientRect = getClientArea(); /* Canvas' painting area */
 | 
				
			||||||
        clientRect.x = -origin.x;
 | 
					//      clientRect.x = -origin.x;
 | 
				
			||||||
        clientRect.y = -origin.y;
 | 
					        clientRect.y = -origin.y;
 | 
				
			||||||
        // reset the transform
 | 
					        // reset the transform
 | 
				
			||||||
        transform.identity();
 | 
					        transform.identity();
 | 
				
			||||||
        // shift the content
 | 
					        // shift the content
 | 
				
			||||||
        transform.translate(origin.x, origin.y);
 | 
					        // DO NOT SHIFT HORIZONTALLY, the range is WAY TOO BIG for float!!!
 | 
				
			||||||
 | 
					        transform.translate(0, origin.y);
 | 
				
			||||||
        gc.setTransform(transform);
 | 
					        gc.setTransform(transform);
 | 
				
			||||||
        gc.setClipping(clientRect);
 | 
					        gc.setClipping(clientRect);
 | 
				
			||||||
        if (painterList.size() > 0 ) {
 | 
					        if (painterList.size() > 0 ) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@
 | 
				
			|||||||
 *******************************************************************************/
 | 
					 *******************************************************************************/
 | 
				
			||||||
package com.minres.scviewer.database.swt.internal;
 | 
					package com.minres.scviewer.database.swt.internal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.awt.Color;
 | 
				
			||||||
import java.beans.PropertyChangeEvent;
 | 
					import java.beans.PropertyChangeEvent;
 | 
				
			||||||
import java.beans.PropertyChangeListener;
 | 
					import java.beans.PropertyChangeListener;
 | 
				
			||||||
import java.beans.PropertyChangeSupport;
 | 
					import java.beans.PropertyChangeSupport;
 | 
				
			||||||
@@ -45,6 +46,7 @@ import org.eclipse.swt.dnd.DropTargetEvent;
 | 
				
			|||||||
import org.eclipse.swt.dnd.Transfer;
 | 
					import org.eclipse.swt.dnd.Transfer;
 | 
				
			||||||
import org.eclipse.swt.events.ControlAdapter;
 | 
					import org.eclipse.swt.events.ControlAdapter;
 | 
				
			||||||
import org.eclipse.swt.events.ControlEvent;
 | 
					import org.eclipse.swt.events.ControlEvent;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeListener;
 | 
				
			||||||
import org.eclipse.swt.events.MouseAdapter;
 | 
					import org.eclipse.swt.events.MouseAdapter;
 | 
				
			||||||
import org.eclipse.swt.events.MouseEvent;
 | 
					import org.eclipse.swt.events.MouseEvent;
 | 
				
			||||||
import org.eclipse.swt.events.MouseListener;
 | 
					import org.eclipse.swt.events.MouseListener;
 | 
				
			||||||
@@ -156,6 +158,7 @@ public class WaveformViewer implements IWaveformViewer  {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		@Override
 | 
							@Override
 | 
				
			||||||
		public void mouseUp(MouseEvent e) {
 | 
							public void mouseUp(MouseEvent e) {
 | 
				
			||||||
 | 
								if(start==null) return;
 | 
				
			||||||
			if((e.stateMask&SWT.MODIFIER_MASK&~SWT.SHIFT)!=0) return; //don't react on modifier
 | 
								if((e.stateMask&SWT.MODIFIER_MASK&~SWT.SHIFT)!=0) return; //don't react on modifier
 | 
				
			||||||
			if (e.button ==  1 && ((e.stateMask&SWT.SHIFT)==0)) {
 | 
								if (e.button ==  1 && ((e.stateMask&SWT.SHIFT)==0)) {
 | 
				
			||||||
				if(Math.abs(e.x-start.x)<3 && Math.abs(e.y-start.y)<3){				
 | 
									if(Math.abs(e.x-start.x)<3 && Math.abs(e.y-start.y)<3){				
 | 
				
			||||||
@@ -489,9 +492,11 @@ public class WaveformViewer implements IWaveformViewer  {
 | 
				
			|||||||
					}while(firstTx!=null && !isArrayFull(resultsList));
 | 
										}while(firstTx!=null && !isArrayFull(resultsList));
 | 
				
			||||||
					entry.currentValue="";
 | 
										entry.currentValue="";
 | 
				
			||||||
					boolean separator=false;
 | 
										boolean separator=false;
 | 
				
			||||||
 | 
														
 | 
				
			||||||
					for(ITx o:resultsList){
 | 
										for(ITx o:resultsList){
 | 
				
			||||||
						if(separator) entry.currentValue+="|";
 | 
											if(separator) entry.currentValue+="|";
 | 
				
			||||||
						if(o!=null) entry.currentValue+=((ITx)o).getGenerator().getName();
 | 
											if(o!=null) entry.currentValue+=((ITx)o).getGenerator().getName();
 | 
				
			||||||
 | 
																
 | 
				
			||||||
						separator=true;
 | 
											separator=true;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -503,6 +508,7 @@ public class WaveformViewer implements IWaveformViewer  {
 | 
				
			|||||||
		valueListScrolled.redraw();
 | 
							valueListScrolled.redraw();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	private boolean isArrayFull(Object[] array){
 | 
						private boolean isArrayFull(Object[] array){
 | 
				
			||||||
		for(Object o:array){
 | 
							for(Object o:array){
 | 
				
			||||||
			if(o==null) return false;
 | 
								if(o==null) return false;
 | 
				
			||||||
@@ -600,6 +606,9 @@ public class WaveformViewer implements IWaveformViewer  {
 | 
				
			|||||||
						TrackEntry trackEntry = getEntryForStream(txSel.getStream());
 | 
											TrackEntry trackEntry = getEntryForStream(txSel.getStream());
 | 
				
			||||||
						if(trackEntry==null && addIfNeeded){
 | 
											if(trackEntry==null && addIfNeeded){
 | 
				
			||||||
							trackEntry=new TrackEntry(txSel.getStream());
 | 
												trackEntry=new TrackEntry(txSel.getStream());
 | 
				
			||||||
 | 
												// compute fallback colors
 | 
				
			||||||
 | 
												Color fallbackColors[] = TrackEntry.computeColor(txSel.getStream().getName(), TrackEntry.fallbackColor, TrackEntry.highlightedFallbackColor);
 | 
				
			||||||
 | 
												trackEntry.setColor(fallbackColors[0], fallbackColors[1]);
 | 
				
			||||||
							streams.add(trackEntry);
 | 
												streams.add(trackEntry);
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
						currentTxSelection = txSel;
 | 
											currentTxSelection = txSel;
 | 
				
			||||||
@@ -1242,4 +1251,9 @@ public class WaveformViewer implements IWaveformViewer  {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						/// probably not the way it should be done
 | 
				
			||||||
 | 
						public void addDisposeListener( DisposeListener listener ) {
 | 
				
			||||||
 | 
							waveformCanvas.addDisposeListener(listener);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ import java.util.List;
 | 
				
			|||||||
import org.eclipse.jface.viewers.ISelection;
 | 
					import org.eclipse.jface.viewers.ISelection;
 | 
				
			||||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
 | 
					import org.eclipse.jface.viewers.ISelectionChangedListener;
 | 
				
			||||||
import org.eclipse.jface.viewers.ISelectionProvider;
 | 
					import org.eclipse.jface.viewers.ISelectionProvider;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeListener;
 | 
				
			||||||
import org.eclipse.swt.graphics.RGB;
 | 
					import org.eclipse.swt.graphics.RGB;
 | 
				
			||||||
import org.eclipse.swt.widgets.Control;
 | 
					import org.eclipse.swt.widgets.Control;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -104,4 +105,6 @@ public interface IWaveformViewer extends PropertyChangeListener, ISelectionProvi
 | 
				
			|||||||
	public void setBaselineTime(Long scale);
 | 
						public void setBaselineTime(Long scale);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public void scrollHorizontal(int percent);
 | 
						public void scrollHorizontal(int percent);
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void addDisposeListener( DisposeListener listener );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -10,13 +10,87 @@
 | 
				
			|||||||
 *******************************************************************************/
 | 
					 *******************************************************************************/
 | 
				
			||||||
package com.minres.scviewer.database.ui;
 | 
					package com.minres.scviewer.database.ui;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.awt.Color;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.minres.scviewer.database.ISignal;
 | 
					import com.minres.scviewer.database.ISignal;
 | 
				
			||||||
import com.minres.scviewer.database.ITxEvent;
 | 
					import com.minres.scviewer.database.ITxEvent;
 | 
				
			||||||
import com.minres.scviewer.database.ITxStream;
 | 
					import com.minres.scviewer.database.ITxStream;
 | 
				
			||||||
import com.minres.scviewer.database.IWaveform;
 | 
					import com.minres.scviewer.database.IWaveform;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
public class TrackEntry {
 | 
					public class TrackEntry {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 	// color info
 | 
				
			||||||
 | 
						public static Color fallbackColor = new Color(200,0,0);
 | 
				
			||||||
 | 
						public static Color highlightedFallbackColor = new Color(255,0,0);
 | 
				
			||||||
 | 
						private Color[]signalColors;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						// list of random colors
 | 
				
			||||||
 | 
						private static Color[][] randomColors = {
 | 
				
			||||||
 | 
								{ new Color( 170,  66,  37 ), new Color ( 190,  66,  37 ) },
 | 
				
			||||||
 | 
								{ new Color(  96,  74, 110 ), new Color (  96,  74, 130 ) },
 | 
				
			||||||
 | 
								{ new Color( 133, 105, 128 ), new Color ( 153, 105, 128 ) },
 | 
				
			||||||
 | 
								{ new Color(   0, 126, 135 ), new Color (   0, 126, 155 ) },
 | 
				
			||||||
 | 
								{ new Color( 243, 146,  75 ), new Color ( 255, 146,  75 ) },
 | 
				
			||||||
 | 
								{ new Color( 206, 135, 163 ), new Color ( 226, 135, 163 ) },
 | 
				
			||||||
 | 
								{ new Color( 124, 103,  74 ), new Color ( 144, 103,  74 ) },
 | 
				
			||||||
 | 
								{ new Color( 194, 187, 169 ), new Color ( 214, 187, 169 ) },
 | 
				
			||||||
 | 
								{ new Color( 104,  73,  71 ), new Color ( 124,  73,  71 ) },
 | 
				
			||||||
 | 
								{ new Color(  75, 196, 213 ), new Color (  75, 196, 233 ) },
 | 
				
			||||||
 | 
								{ new Color( 206, 232, 229 ), new Color ( 206, 252, 229 ) },
 | 
				
			||||||
 | 
								{ new Color( 169, 221, 199 ), new Color ( 169, 241, 199 ) },
 | 
				
			||||||
 | 
								{ new Color( 100, 165, 197 ), new Color ( 100, 165, 217 ) },
 | 
				
			||||||
 | 
								{ new Color( 150, 147, 178 ), new Color ( 150, 147, 198 ) },
 | 
				
			||||||
 | 
								{ new Color( 200, 222, 182 ), new Color ( 200, 242, 182 ) },
 | 
				
			||||||
 | 
								{ new Color( 147, 208, 197 ), new Color ( 147, 228, 197 ) }
 | 
				
			||||||
 | 
						};
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public static Color[] computeColor (String streamValue, Color fallback, Color highlightedFallback) {
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
							Color[]result = new Color[2];
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
							result[0] = fallback;
 | 
				
			||||||
 | 
							result[1] = highlightedFallback;
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// assign colors to standard values
 | 
				
			||||||
 | 
							if (streamValue.contains("read")){
 | 
				
			||||||
 | 
								result[0] = new Color(86,174,53);
 | 
				
			||||||
 | 
								result[1] = new Color (86,194,53);
 | 
				
			||||||
 | 
							}else if (streamValue.contains("rdata")){
 | 
				
			||||||
 | 
								result[0] = new Color(138,151,71);
 | 
				
			||||||
 | 
								result[1] = new Color (138,171,71);
 | 
				
			||||||
 | 
							}else if (streamValue.contains("addr")){
 | 
				
			||||||
 | 
								result[0] = new Color(233,187,68);
 | 
				
			||||||
 | 
								result[1] = new Color (233,207,68);
 | 
				
			||||||
 | 
							}else if (streamValue.contains("write")){
 | 
				
			||||||
 | 
								result[0] = new Color(1,128,191);
 | 
				
			||||||
 | 
								result[1] = new Color (1,128,211);
 | 
				
			||||||
 | 
							}else if (streamValue.contains("wdata")){
 | 
				
			||||||
 | 
								result[0] = new Color(2,181,160);
 | 
				
			||||||
 | 
								result[1] = new Color (2,201,160);
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
							}else {
 | 
				
			||||||
 | 
								// assign "random" color here, one name always results in the same color!
 | 
				
			||||||
 | 
								if( randomColors.length > 0 ) {
 | 
				
			||||||
 | 
									int index = Math.abs(streamValue.hashCode()) % randomColors.length;
 | 
				
			||||||
 | 
									result[0] = randomColors[index][0];
 | 
				
			||||||
 | 
									result[1] = randomColors[index][1];
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							return result;
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public void setColor(Color changedColor, Color highlightColor) {
 | 
				
			||||||
 | 
							signalColors[0] = changedColor;
 | 
				
			||||||
 | 
							signalColors[1] = highlightColor;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public Color[] getColors() {
 | 
				
			||||||
 | 
							return signalColors;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	public enum ValueDisplay {
 | 
						public enum ValueDisplay {
 | 
				
			||||||
		DEFAULT, SIGNED, UNSIGNED
 | 
							DEFAULT, SIGNED, UNSIGNED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -45,6 +119,9 @@ public class TrackEntry {
 | 
				
			|||||||
		vOffset=0;
 | 
							vOffset=0;
 | 
				
			||||||
		height=0;
 | 
							height=0;
 | 
				
			||||||
		selected=false;
 | 
							selected=false;
 | 
				
			||||||
 | 
							signalColors = new Color[2];
 | 
				
			||||||
 | 
							signalColors[0] = fallbackColor;
 | 
				
			||||||
 | 
							signalColors[1] = highlightedFallbackColor;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public boolean isStream(){
 | 
						public boolean isStream(){
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
<classpath>
 | 
					<classpath>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
					 | 
				
			||||||
	<classpathentry kind="src" path="src"/>
 | 
					 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
						<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
				
			||||||
 | 
						<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
				
			||||||
 | 
						<classpathentry kind="src" path="src/"/>
 | 
				
			||||||
	<classpathentry kind="output" path="target/classes"/>
 | 
						<classpathentry kind="output" path="target/classes"/>
 | 
				
			||||||
</classpath>
 | 
					</classpath>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
@@ -8,7 +8,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 | 
				
			|||||||
Export-Package: com.minres.scviewer.database
 | 
					Export-Package: com.minres.scviewer.database
 | 
				
			||||||
Bundle-ActivationPolicy: lazy
 | 
					Bundle-ActivationPolicy: lazy
 | 
				
			||||||
Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
 | 
					Service-Component: OSGI-INF/component.xml,OSGI-INF/component2.xml
 | 
				
			||||||
Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.4.200",
 | 
					 | 
				
			||||||
 org.eclipse.equinox.util;bundle-version="1.0.500",
 | 
					 | 
				
			||||||
 org.eclipse.osgi.services;bundle-version="3.4.0"
 | 
					 | 
				
			||||||
Automatic-Module-Name: com.minres.scviewer.database
 | 
					Automatic-Module-Name: com.minres.scviewer.database
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,6 +76,7 @@ public class BitVector {
 | 
				
			|||||||
		for(int i=resWidth-1; i>=0; i--){
 | 
							for(int i=resWidth-1; i>=0; i--){
 | 
				
			||||||
			int digit=0;
 | 
								int digit=0;
 | 
				
			||||||
			for(int j=3; j>=0; j--){
 | 
								for(int j=3; j>=0; j--){
 | 
				
			||||||
 | 
									if((4*i+j)>=value.length) continue;
 | 
				
			||||||
				BitValue val = BitValue.fromChar(value[4*i+j]);
 | 
									BitValue val = BitValue.fromChar(value[4*i+j]);
 | 
				
			||||||
				switch(val) {
 | 
									switch(val) {
 | 
				
			||||||
				case X:
 | 
									case X:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,5 +3,5 @@
 | 
				
			|||||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
						<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
						<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
				
			||||||
	<classpathentry kind="src" path="src"/>
 | 
						<classpathentry kind="src" path="src"/>
 | 
				
			||||||
	<classpathentry kind="output" path="bin"/>
 | 
						<classpathentry kind="output" path="target/classes"/>
 | 
				
			||||||
</classpath>
 | 
					</classpath>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,7 +26,9 @@
 | 
				
			|||||||
            </menus>
 | 
					            </menus>
 | 
				
			||||||
          </children>
 | 
					          </children>
 | 
				
			||||||
          <children xsi:type="basic:PartSashContainer" xmi:id="_uT9BIHgtEeWwZ-9vrAR2UQ" elementId="" containerData="80">
 | 
					          <children xsi:type="basic:PartSashContainer" xmi:id="_uT9BIHgtEeWwZ-9vrAR2UQ" elementId="" containerData="80">
 | 
				
			||||||
            <children xsi:type="basic:PartStack" xmi:id="_95QGyXNmEeWBq8z1Dv39LA" elementId="org.eclipse.editorss" containerData="75"/>
 | 
					            <children xsi:type="basic:PartStack" xmi:id="_95QGyXNmEeWBq8z1Dv39LA" elementId="org.eclipse.editorss" containerData="75">
 | 
				
			||||||
 | 
					              <tags>NoAutoCollapse</tags>
 | 
				
			||||||
 | 
					            </children>
 | 
				
			||||||
            <children xsi:type="basic:Part" xmi:id="_vtfm8HgtEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parts.WaveformDetails" containerData="25" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.TransactionDetails" label="Waveform Details"/>
 | 
					            <children xsi:type="basic:Part" xmi:id="_vtfm8HgtEeWwZ-9vrAR2UQ" elementId="com.minres.scviewer.e4.application.parts.WaveformDetails" containerData="25" contributionURI="bundleclass://com.minres.scviewer.e4.application/com.minres.scviewer.e4.application.parts.TransactionDetails" label="Waveform Details"/>
 | 
				
			||||||
          </children>
 | 
					          </children>
 | 
				
			||||||
        </children>
 | 
					        </children>
 | 
				
			||||||
@@ -36,10 +38,10 @@
 | 
				
			|||||||
    <mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
 | 
					    <mainMenu xmi:id="_95PfyXNmEeWBq8z1Dv39LA" elementId="menu:org.eclipse.ui.main.menu">
 | 
				
			||||||
      <children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
 | 
					      <children xsi:type="menu:Menu" xmi:id="_95QGwHNmEeWBq8z1Dv39LA" elementId="com.minres.scviewer.e4.application.menu.file" label="File">
 | 
				
			||||||
        <children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
 | 
					        <children xsi:type="menu:HandledMenuItem" xmi:id="_VJG3YHgvEeWwZ-9vrAR2UQ" elementId="" label="Open Database" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_database.png" command="_95PfwHNmEeWBq8z1Dv39LA"/>
 | 
				
			||||||
        <children xsi:type="menu:HandledMenuItem" xmi:id="_e7MOYJedEeW09eyIbHsdvg" elementId="" label="Load settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
 | 
					        <children xsi:type="menu:HandledMenuItem" xmi:id="_e7MOYJedEeW09eyIbHsdvg" elementId="" label="Load active tab settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/folder_page.png" command="_7-AIMJebEeW09eyIbHsdvg">
 | 
				
			||||||
          <parameters xmi:id="_4vtYgJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.30" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
 | 
					          <parameters xmi:id="_4vtYgJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.30" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="load"/>
 | 
				
			||||||
        </children>
 | 
					        </children>
 | 
				
			||||||
        <children xsi:type="menu:HandledMenuItem" xmi:id="_95QGwnNmEeWBq8z1Dv39LA" label="Save settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/script_save.png" command="_7-AIMJebEeW09eyIbHsdvg">
 | 
					        <children xsi:type="menu:HandledMenuItem" xmi:id="_95QGwnNmEeWBq8z1Dv39LA" label="Save active tab settings" iconURI="platform:/plugin/com.minres.scviewer.e4.application/icons/script_save.png" command="_7-AIMJebEeW09eyIbHsdvg">
 | 
				
			||||||
          <parameters xmi:id="_61QIsJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.31" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="store"/>
 | 
					          <parameters xmi:id="_61QIsJehEeW09eyIbHsdvg" elementId="com.minres.scviewer.e4.application.parameter.31" name="com.minres.scviewer.e4.application.commandparameter.loadStore" value="store"/>
 | 
				
			||||||
        </children>
 | 
					        </children>
 | 
				
			||||||
        <children xsi:type="menu:HandledMenuItem" xmi:id="_95QGw3NmEeWBq8z1Dv39LA" label="Quit" command="_95PfvHNmEeWBq8z1Dv39LA"/>
 | 
					        <children xsi:type="menu:HandledMenuItem" xmi:id="_95QGw3NmEeWBq8z1Dv39LA" label="Quit" command="_95PfvHNmEeWBq8z1Dv39LA"/>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 | 
				
			|||||||
Bundle-ManifestVersion: 2
 | 
					Bundle-ManifestVersion: 2
 | 
				
			||||||
Bundle-Name: %Bundle-Name
 | 
					Bundle-Name: %Bundle-Name
 | 
				
			||||||
Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
 | 
					Bundle-SymbolicName: com.minres.scviewer.e4.application;singleton:=true
 | 
				
			||||||
Bundle-Version: 2.0.2.qualifier
 | 
					Bundle-Version: 2.1.4.qualifier
 | 
				
			||||||
Bundle-Vendor: %Bundle-Vendor
 | 
					Bundle-Vendor: %Bundle-Vendor
 | 
				
			||||||
Require-Bundle: javax.inject;bundle-version="1.0.0",
 | 
					Require-Bundle: javax.inject;bundle-version="1.0.0",
 | 
				
			||||||
  org.eclipse.core.runtime;bundle-version="3.11.1",
 | 
					  org.eclipse.core.runtime;bundle-version="3.11.1",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
					<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
				
			||||||
  <modelVersion>4.0.0</modelVersion>
 | 
					  <modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
  <artifactId>com.minres.scviewer.e4.application</artifactId>
 | 
					  <artifactId>com.minres.scviewer.e4.application</artifactId>
 | 
				
			||||||
  <version>2.0.2-SNAPSHOT</version>
 | 
					  <version>2.1.4-SNAPSHOT</version>
 | 
				
			||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
  	<groupId>com.minres.scviewer</groupId>
 | 
					  	<groupId>com.minres.scviewer</groupId>
 | 
				
			||||||
  	<artifactId>com.minres.scviewer.parent</artifactId>
 | 
					  	<artifactId>com.minres.scviewer.parent</artifactId>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,13 +40,16 @@ public class AddWaveformHandler {
 | 
				
			|||||||
			@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection) {
 | 
								@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection) {
 | 
				
			||||||
		if(designBrowser==null) designBrowser = getListPart( partService);
 | 
							if(designBrowser==null) designBrowser = getListPart( partService);
 | 
				
			||||||
		if(designBrowser==null || designBrowser.getActiveWaveformViewerPart()==null) return false;
 | 
							if(designBrowser==null || designBrowser.getActiveWaveformViewerPart()==null) return false;
 | 
				
			||||||
		Boolean before = "before".equalsIgnoreCase(where); //$NON-NLS-1$
 | 
							boolean before = "before".equalsIgnoreCase(where); //$NON-NLS-1$
 | 
				
			||||||
 | 
							IStructuredSelection waveformSelection = null;
 | 
				
			||||||
 | 
							if(designBrowser.getActiveWaveformViewerPart()!=null)
 | 
				
			||||||
 | 
								waveformSelection = (IStructuredSelection)designBrowser.getActiveWaveformViewerPart().getSelection();
 | 
				
			||||||
		if("true".equalsIgnoreCase(all))  //$NON-NLS-1$
 | 
							if("true".equalsIgnoreCase(all))  //$NON-NLS-1$
 | 
				
			||||||
			return designBrowser.getFilteredChildren().length>0 && 
 | 
								return designBrowser.getFilteredChildren().length>0 && 
 | 
				
			||||||
					(!before || ((IStructuredSelection)designBrowser.getActiveWaveformViewerPart().getSelection()).size()>0);
 | 
										(!before || (waveformSelection!=null && waveformSelection.size()>0));
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			return selection.size()>0 && 
 | 
								return selection!=null && selection.size()>0 && 
 | 
				
			||||||
					(!before || ((IStructuredSelection)designBrowser.getActiveWaveformViewerPart().getSelection()).size()>0);
 | 
										(!before || (waveformSelection!=null && waveformSelection.size()>0));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	@Execute
 | 
						@Execute
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,8 @@
 | 
				
			|||||||
 *******************************************************************************/
 | 
					 *******************************************************************************/
 | 
				
			||||||
package com.minres.scviewer.e4.application.handlers;
 | 
					package com.minres.scviewer.e4.application.handlers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.io.File;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.inject.Named;
 | 
					import javax.inject.Named;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.eclipse.e4.core.di.annotations.CanExecute;
 | 
					import org.eclipse.e4.core.di.annotations.CanExecute;
 | 
				
			||||||
@@ -20,6 +22,7 @@ import org.eclipse.e4.ui.workbench.modeling.EModelService;
 | 
				
			|||||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
 | 
					import org.eclipse.e4.ui.workbench.modeling.EPartService;
 | 
				
			||||||
import org.eclipse.swt.SWT;
 | 
					import org.eclipse.swt.SWT;
 | 
				
			||||||
import org.eclipse.swt.widgets.FileDialog;
 | 
					import org.eclipse.swt.widgets.FileDialog;
 | 
				
			||||||
 | 
					import org.eclipse.swt.widgets.MessageBox;
 | 
				
			||||||
import org.eclipse.swt.widgets.Shell;
 | 
					import org.eclipse.swt.widgets.Shell;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.minres.scviewer.e4.application.Messages;
 | 
					import com.minres.scviewer.e4.application.Messages;
 | 
				
			||||||
@@ -38,21 +41,60 @@ public class LoadStoreSettingsHandler {
 | 
				
			|||||||
	@Execute
 | 
						@Execute
 | 
				
			||||||
	public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService, 
 | 
						public void execute(@Named(PARAMETER_ID) String param, Shell shell, MApplication app, EModelService modelService, 
 | 
				
			||||||
			EPartService partService){
 | 
								EPartService partService){
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		boolean load = "load".equals(param); //$NON-NLS-1$
 | 
							boolean load = "load".equals(param); //$NON-NLS-1$
 | 
				
			||||||
		FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE);
 | 
							FileDialog dialog = new FileDialog(shell, load?SWT.OPEN:SWT.SAVE);
 | 
				
			||||||
		dialog.setFilterExtensions (new String []{Messages.LoadStoreSettingsHandler_2});
 | 
							dialog.setFilterExtensions (new String []{Messages.LoadStoreSettingsHandler_2});
 | 
				
			||||||
		if(!load) dialog.setFileName(Messages.LoadStoreSettingsHandler_3);
 | 
							if(!load) dialog.setFileName(Messages.LoadStoreSettingsHandler_3);
 | 
				
			||||||
		String res = dialog.open();
 | 
					 | 
				
			||||||
		MPart part = partService.getActivePart();
 | 
					 | 
				
			||||||
		if(res!=null && part!=null){
 | 
					 | 
				
			||||||
			Object obj = part.getObject();
 | 
					 | 
				
			||||||
			if(obj instanceof WaveformViewer){
 | 
					 | 
				
			||||||
				if(load)
 | 
					 | 
				
			||||||
					((WaveformViewer)obj).loadState(res);
 | 
					 | 
				
			||||||
				else
 | 
					 | 
				
			||||||
					((WaveformViewer)obj).saveState(res);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 | 
							String fileName = null;
 | 
				
			||||||
 | 
							MPart part = partService.getActivePart();
 | 
				
			||||||
 | 
							Object obj = part.getObject();
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// Save active tab settings
 | 
				
			||||||
 | 
							if(!load) {
 | 
				
			||||||
 | 
								// 3 possible cases when when saving active tab settings:
 | 
				
			||||||
 | 
								// - user dismisses the dialog by pressing Cancel
 | 
				
			||||||
 | 
								// - selected file name does not exist
 | 
				
			||||||
 | 
								// - user agrees to overwrite existing file
 | 
				
			||||||
 | 
								boolean done = false;
 | 
				
			||||||
 | 
								while (!done) {
 | 
				
			||||||
 | 
									// open the File Dialog
 | 
				
			||||||
 | 
									fileName = dialog.open();
 | 
				
			||||||
 | 
									if (fileName == null) {
 | 
				
			||||||
 | 
										// user has cancelled -> quit and return
 | 
				
			||||||
 | 
										done = true;
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										// user has selected a file -> see if it already exists
 | 
				
			||||||
 | 
										File file = new File(fileName);
 | 
				
			||||||
 | 
										if (file.exists()) {
 | 
				
			||||||
 | 
											// file already exists -> asks for confirmation
 | 
				
			||||||
 | 
											MessageBox mb = new MessageBox(dialog.getParent(), SWT.ICON_WARNING
 | 
				
			||||||
 | 
													| SWT.YES | SWT.NO);
 | 
				
			||||||
 | 
											mb.setText("Confirm overwrite");
 | 
				
			||||||
 | 
											mb.setMessage(fileName + " already exists. Do you want to overwrite it?");
 | 
				
			||||||
 | 
											// user clicks Yes -> all done, drop out 
 | 
				
			||||||
 | 
											if(mb.open() == SWT.YES) {
 | 
				
			||||||
 | 
												((WaveformViewer)obj).saveState(fileName);
 | 
				
			||||||
 | 
												done = true;
 | 
				
			||||||
 | 
											} else { // user clicks No -> redisplay the File Dialog
 | 
				
			||||||
 | 
												done = false;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											// file does not exist -> save and drop out
 | 
				
			||||||
 | 
											((WaveformViewer)obj).saveState(fileName);
 | 
				
			||||||
 | 
											done = true;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
 | 
							} // end if(!load)
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						    else { // load active tab settings
 | 
				
			||||||
 | 
						    	String res = dialog.open();
 | 
				
			||||||
 | 
						    	if(res != null && part!=null && (obj instanceof WaveformViewer)) { 
 | 
				
			||||||
 | 
						        	((WaveformViewer)obj).loadState(res);
 | 
				
			||||||
 | 
						    	}
 | 
				
			||||||
 | 
						    }
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -59,7 +59,7 @@ public class WaveStatusBarControl extends StatusBarControl {
 | 
				
			|||||||
		final String labelString;
 | 
							final String labelString;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		/** The width. */
 | 
							/** The width. */
 | 
				
			||||||
		final int width;
 | 
							//final int width;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		/** The text. */
 | 
							/** The text. */
 | 
				
			||||||
		CLabel label, text;
 | 
							CLabel label, text;
 | 
				
			||||||
@@ -73,10 +73,10 @@ public class WaveStatusBarControl extends StatusBarControl {
 | 
				
			|||||||
		 * @param labelString the label string
 | 
							 * @param labelString the label string
 | 
				
			||||||
		 * @param width the width
 | 
							 * @param width the width
 | 
				
			||||||
		 */
 | 
							 */
 | 
				
			||||||
		public TextContributionItem(String labelString, int width) {
 | 
							public TextContributionItem(String labelString /*, int width */) {
 | 
				
			||||||
			super();
 | 
								super();
 | 
				
			||||||
			this.labelString = labelString;
 | 
								this.labelString = labelString;
 | 
				
			||||||
			this.width=width;
 | 
								//this.width=width;
 | 
				
			||||||
			content=""; //$NON-NLS-1$
 | 
								content=""; //$NON-NLS-1$
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -85,14 +85,16 @@ public class WaveStatusBarControl extends StatusBarControl {
 | 
				
			|||||||
		 */
 | 
							 */
 | 
				
			||||||
		@Override
 | 
							@Override
 | 
				
			||||||
		public void fill(Composite parent) {
 | 
							public void fill(Composite parent) {
 | 
				
			||||||
			Composite box=new Composite(parent, SWT.NONE);
 | 
								Composite box=new Composite(parent, SWT.NONE); //NONE
 | 
				
			||||||
			box.setLayout(new GridLayout(2, false));
 | 
								box.setLayout(new GridLayout(2, false));
 | 
				
			||||||
			label=new CLabel(box, SWT.SHADOW_NONE);	
 | 
								label=new CLabel(box, SWT.SHADOW_NONE);	
 | 
				
			||||||
			label.setText(labelString);
 | 
								label.setText(labelString);
 | 
				
			||||||
			text=new CLabel(box, SWT.SHADOW_IN);
 | 
								text=new CLabel(box, SWT.SHADOW_IN);
 | 
				
			||||||
			text.setAlignment(SWT.RIGHT);
 | 
								text.setAlignment(SWT.RIGHT);
 | 
				
			||||||
 | 
								//GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
 | 
				
			||||||
			GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
 | 
								GridData layoutData=new GridData(SWT.DEFAULT, SWT.DEFAULT, true, false);
 | 
				
			||||||
			layoutData.minimumWidth=width;
 | 
								layoutData.minimumWidth=70;
 | 
				
			||||||
 | 
								//layoutData.minimumWidth=width;
 | 
				
			||||||
			text.setLayoutData(layoutData);
 | 
								text.setLayoutData(layoutData);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -127,10 +129,11 @@ public class WaveStatusBarControl extends StatusBarControl {
 | 
				
			|||||||
	@Inject
 | 
						@Inject
 | 
				
			||||||
	public WaveStatusBarControl(UISynchronize sync) {
 | 
						public WaveStatusBarControl(UISynchronize sync) {
 | 
				
			||||||
		super(sync);
 | 
							super(sync);
 | 
				
			||||||
		cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5, 150);
 | 
									
 | 
				
			||||||
		markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6, 150);
 | 
							cursorContribution = new TextContributionItem(Messages.WaveStatusBarControl_5 /*, 150 */); //150
 | 
				
			||||||
		markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7, 150);
 | 
							markerContribution = new TextContributionItem(Messages.WaveStatusBarControl_6 /*, 150 */); //150
 | 
				
			||||||
		zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8, 60);
 | 
							markerDiffContribution = new TextContributionItem(Messages.WaveStatusBarControl_7 /*, 150 */); //150
 | 
				
			||||||
 | 
							zoomContribution = new TextContributionItem(Messages.WaveStatusBarControl_8 /*, 60 */); //60
 | 
				
			||||||
		manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
 | 
							manager.appendToGroup(StatusLineManager.BEGIN_GROUP,cursorContribution);
 | 
				
			||||||
		manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
 | 
							manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerContribution);
 | 
				
			||||||
		manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
 | 
							manager.appendToGroup(StatusLineManager.BEGIN_GROUP,markerDiffContribution);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
AboutDialog_0=\nSCViewer - a SystemC waveform viewer\n\nVersion: 2.0\n
 | 
					AboutDialog_0=\nSCViewer - a SystemC waveform viewer\n\nVersion: {0}\n
 | 
				
			||||||
AboutDialog_1=\nCopyright (c) 2015, 2018 MINRES Technologies GmbH and others.\n\nAll rights reserved. MINRES and the MINRES logo are trademarks of MINRES Technologies GmbH, http://www.minres.com/. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\nParts of the software are governed by the Apache License Version 2.0 available at http://www.apache.org/licenses/. These are namely org.mapdb and org.sqlite JDBC driver\n\nSource code is hosted at https://git.minres.com/VP/SCViewer and the master branch is mirrored to GitHub: https://git.com/minres/SCViewer\n
 | 
					AboutDialog_1=\nCopyright (c) 2015, 2019 MINRES Technologies GmbH and others.\n\nAll rights reserved. MINRES and the MINRES logo are trademarks of MINRES Technologies GmbH, http://www.minres.com/. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html\n\nParts of the software are governed by the Apache License Version 2.0 available at http://www.apache.org/licenses/. These are namely org.mapdb and org.sqlite JDBC driver\n\nSource code is hosted at https://git.minres.com/VP-Tools/SCViewer and the master branch is mirrored to GitHub: https://github.com/minres/SCViewer\n
 | 
				
			||||||
DesignBrowser_12=Append all after
 | 
					DesignBrowser_12=Append all after
 | 
				
			||||||
DesignBrowser_16=Insert all before
 | 
					DesignBrowser_16=Insert all before
 | 
				
			||||||
DesignBrowser_2=Enter text to filter waveforms
 | 
					DesignBrowser_2=Enter text to filter waveforms
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,8 +19,10 @@ import java.util.regex.Pattern;
 | 
				
			|||||||
import javax.annotation.PostConstruct;
 | 
					import javax.annotation.PostConstruct;
 | 
				
			||||||
import javax.inject.Inject;
 | 
					import javax.inject.Inject;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import org.eclipse.core.runtime.Platform;
 | 
				
			||||||
import org.eclipse.jface.dialogs.Dialog;
 | 
					import org.eclipse.jface.dialogs.Dialog;
 | 
				
			||||||
import org.eclipse.jface.dialogs.IDialogConstants;
 | 
					import org.eclipse.jface.dialogs.IDialogConstants;
 | 
				
			||||||
 | 
					import org.eclipse.osgi.util.NLS;
 | 
				
			||||||
import org.eclipse.swt.SWT;
 | 
					import org.eclipse.swt.SWT;
 | 
				
			||||||
import org.eclipse.swt.custom.StyleRange;
 | 
					import org.eclipse.swt.custom.StyleRange;
 | 
				
			||||||
import org.eclipse.swt.custom.StyledText;
 | 
					import org.eclipse.swt.custom.StyledText;
 | 
				
			||||||
@@ -39,6 +41,7 @@ import org.eclipse.swt.widgets.Listener;
 | 
				
			|||||||
import org.eclipse.swt.widgets.Shell;
 | 
					import org.eclipse.swt.widgets.Shell;
 | 
				
			||||||
import org.eclipse.wb.swt.ResourceManager;
 | 
					import org.eclipse.wb.swt.ResourceManager;
 | 
				
			||||||
import org.eclipse.wb.swt.SWTResourceManager;
 | 
					import org.eclipse.wb.swt.SWTResourceManager;
 | 
				
			||||||
 | 
					import org.osgi.framework.Version;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.minres.scviewer.e4.application.Messages;
 | 
					import com.minres.scviewer.e4.application.Messages;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -101,7 +104,10 @@ public class AboutDialog extends Dialog {
 | 
				
			|||||||
		styledText.setEditable(false);
 | 
							styledText.setEditable(false);
 | 
				
			||||||
		GridData gd_styledText = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
 | 
							GridData gd_styledText = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
 | 
				
			||||||
		styledText.setLayoutData(gd_styledText);
 | 
							styledText.setLayoutData(gd_styledText);
 | 
				
			||||||
		styledText.setText(productTitle+copyrightText);
 | 
							Version version = Platform.getProduct().getDefiningBundle().getVersion();
 | 
				
			||||||
 | 
							String versionString = String.format("%d.%d.%d", version.getMajor(), version.getMinor(), version.getMicro());
 | 
				
			||||||
 | 
							String pt = NLS.bind(Messages.AboutDialog_0, versionString);
 | 
				
			||||||
 | 
							styledText.setText(pt+copyrightText);
 | 
				
			||||||
		styledText.setBackground(white);
 | 
							styledText.setBackground(white);
 | 
				
			||||||
		styledText.setWordWrap(true);
 | 
							styledText.setWordWrap(true);
 | 
				
			||||||
		styledText.setLeftMargin(5);
 | 
							styledText.setLeftMargin(5);
 | 
				
			||||||
@@ -133,7 +139,7 @@ public class AboutDialog extends Dialog {
 | 
				
			|||||||
				// links are activated on mouse down when the control key is held down 
 | 
									// links are activated on mouse down when the control key is held down 
 | 
				
			||||||
//				if ((event.stateMask & SWT.MOD1) != 0) {
 | 
					//				if ((event.stateMask & SWT.MOD1) != 0) {
 | 
				
			||||||
					try {
 | 
										try {
 | 
				
			||||||
						int offset = ((StyledText)event.widget).getOffsetAtPoint(new Point (event.x, event.y));
 | 
											int offset = ((StyledText)event.widget).getOffsetAtLocation(new Point (event.x, event.y));
 | 
				
			||||||
						StyleRange style = ((StyledText)event.widget).getStyleRangeAtOffset(offset);
 | 
											StyleRange style = ((StyledText)event.widget).getStyleRangeAtOffset(offset);
 | 
				
			||||||
						if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK) {
 | 
											if (style != null && style.underline && style.underlineStyle == SWT.UNDERLINE_LINK) {
 | 
				
			||||||
							Desktop.getDesktop().browse(new java.net.URI(style.data.toString()));
 | 
												Desktop.getDesktop().browse(new java.net.URI(style.data.toString()));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,6 +15,7 @@ import java.beans.PropertyChangeListener;
 | 
				
			|||||||
import java.lang.annotation.Annotation;
 | 
					import java.lang.annotation.Annotation;
 | 
				
			||||||
import java.util.Arrays;
 | 
					import java.util.Arrays;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.regex.PatternSyntaxException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.annotation.PostConstruct;
 | 
					import javax.annotation.PostConstruct;
 | 
				
			||||||
import javax.inject.Inject;
 | 
					import javax.inject.Inject;
 | 
				
			||||||
@@ -49,6 +50,8 @@ import org.eclipse.swt.SWT;
 | 
				
			|||||||
import org.eclipse.swt.custom.SashForm;
 | 
					import org.eclipse.swt.custom.SashForm;
 | 
				
			||||||
import org.eclipse.swt.events.ControlAdapter;
 | 
					import org.eclipse.swt.events.ControlAdapter;
 | 
				
			||||||
import org.eclipse.swt.events.ControlEvent;
 | 
					import org.eclipse.swt.events.ControlEvent;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeEvent;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeListener;
 | 
				
			||||||
import org.eclipse.swt.events.ModifyEvent;
 | 
					import org.eclipse.swt.events.ModifyEvent;
 | 
				
			||||||
import org.eclipse.swt.events.ModifyListener;
 | 
					import org.eclipse.swt.events.ModifyListener;
 | 
				
			||||||
import org.eclipse.swt.events.PaintEvent;
 | 
					import org.eclipse.swt.events.PaintEvent;
 | 
				
			||||||
@@ -58,6 +61,7 @@ import org.eclipse.swt.events.SelectionEvent;
 | 
				
			|||||||
import org.eclipse.swt.layout.GridData;
 | 
					import org.eclipse.swt.layout.GridData;
 | 
				
			||||||
import org.eclipse.swt.layout.GridLayout;
 | 
					import org.eclipse.swt.layout.GridLayout;
 | 
				
			||||||
import org.eclipse.swt.widgets.Composite;
 | 
					import org.eclipse.swt.widgets.Composite;
 | 
				
			||||||
 | 
					import org.eclipse.swt.widgets.Control;
 | 
				
			||||||
import org.eclipse.swt.widgets.Text;
 | 
					import org.eclipse.swt.widgets.Text;
 | 
				
			||||||
import org.eclipse.swt.widgets.ToolBar;
 | 
					import org.eclipse.swt.widgets.ToolBar;
 | 
				
			||||||
import org.eclipse.swt.widgets.ToolItem;
 | 
					import org.eclipse.swt.widgets.ToolItem;
 | 
				
			||||||
@@ -198,10 +202,14 @@ public class DesignBrowser {
 | 
				
			|||||||
				ISelection selection=event.getSelection();
 | 
									ISelection selection=event.getSelection();
 | 
				
			||||||
				if( selection instanceof IStructuredSelection) { 
 | 
									if( selection instanceof IStructuredSelection) { 
 | 
				
			||||||
					Object object= ((IStructuredSelection)selection).getFirstElement();			
 | 
										Object object= ((IStructuredSelection)selection).getFirstElement();			
 | 
				
			||||||
					if(object instanceof IHierNode&& ((IHierNode)object).getChildNodes().size()!=0){
 | 
										if(object instanceof IHierNode && ((IHierNode)object).getChildNodes().size()!=0){
 | 
				
			||||||
						txTableViewer.setInput(object);
 | 
											txTableViewer.setInput(object);
 | 
				
			||||||
						updateButtons();
 | 
											updateButtons();
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 | 
										else { //if selection is changed but empty
 | 
				
			||||||
 | 
											txTableViewer.setInput(null);
 | 
				
			||||||
 | 
											updateButtons();
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
@@ -247,8 +255,8 @@ public class DesignBrowser {
 | 
				
			|||||||
			
 | 
								
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public void selectionChanged(SelectionChangedEvent event) {
 | 
								public void selectionChanged(SelectionChangedEvent event) {
 | 
				
			||||||
					selectionService.setSelection(event.getSelection());
 | 
									selectionService.setSelection(event.getSelection());
 | 
				
			||||||
					updateButtons();
 | 
									updateButtons();
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -345,6 +353,16 @@ public class DesignBrowser {
 | 
				
			|||||||
		updateButtons();
 | 
							updateButtons();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						/** 
 | 
				
			||||||
 | 
						 * reset tree viewer and tableviewer after every closed tab
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						protected void resetTreeViewer() {
 | 
				
			||||||
 | 
							//reset tree- and tableviewer
 | 
				
			||||||
 | 
							treeViewer.setInput(null);
 | 
				
			||||||
 | 
							txTableViewer.setInput(null);
 | 
				
			||||||
 | 
							txTableViewer.setSelection(null);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Gets the status event.
 | 
						 * Gets the status event.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
@@ -354,14 +372,28 @@ public class DesignBrowser {
 | 
				
			|||||||
	@SuppressWarnings("unchecked")
 | 
						@SuppressWarnings("unchecked")
 | 
				
			||||||
	@Inject @Optional
 | 
						@Inject @Optional
 | 
				
			||||||
	public void  getActiveWaveformViewerEvent(@UIEventTopic(WaveformViewer.ACTIVE_WAVEFORMVIEW) WaveformViewer waveformViewerPart) {
 | 
						public void  getActiveWaveformViewerEvent(@UIEventTopic(WaveformViewer.ACTIVE_WAVEFORMVIEW) WaveformViewer waveformViewerPart) {
 | 
				
			||||||
		if(this.waveformViewerPart!=null)
 | 
							if(this.waveformViewerPart!=null) { 
 | 
				
			||||||
			this.waveformViewerPart.storeDesignBrowerState(new DBState());
 | 
								this.waveformViewerPart.storeDesignBrowerState(new DBState());
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if( this.waveformViewerPart == null || this.waveformViewerPart != waveformViewerPart ) {
 | 
				
			||||||
 | 
								waveformViewerPart.addDisposeListener( new DisposeListener() {
 | 
				
			||||||
 | 
									@Override
 | 
				
			||||||
 | 
									public void widgetDisposed(DisposeEvent e) {
 | 
				
			||||||
 | 
										Control control = treeViewer.getControl();
 | 
				
			||||||
 | 
										// check if widget is already disposed (f.ex. because of workbench closing)
 | 
				
			||||||
 | 
										if (control == null || control.isDisposed()) { //if so: do nothing
 | 
				
			||||||
 | 
										}else {  //reset tree- and tableviewer
 | 
				
			||||||
 | 
											resetTreeViewer();
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								} );
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		this.waveformViewerPart=waveformViewerPart;
 | 
							this.waveformViewerPart=waveformViewerPart;
 | 
				
			||||||
		IWaveformDb database = waveformViewerPart.getDatabase();
 | 
							IWaveformDb database = waveformViewerPart.getDatabase();
 | 
				
			||||||
		Object input = treeViewer.getInput();
 | 
							Object input = treeViewer.getInput();
 | 
				
			||||||
		if(input!=null && input instanceof List<?>){
 | 
							if(input!=null && input instanceof List<?>){
 | 
				
			||||||
			IWaveformDb db = ((List<IWaveformDb>)input).get(0);
 | 
								IWaveformDb db = ((List<IWaveformDb>)input).get(0);
 | 
				
			||||||
			if(db==database) return; // do nothing if old and new daabase is the same
 | 
								if(db==database) return; // do nothing if old and new database is the same
 | 
				
			||||||
			((List<IWaveformDb>)input).get(0).removePropertyChangeListener(treeViewerPCL);
 | 
								((List<IWaveformDb>)input).get(0).removePropertyChangeListener(treeViewerPCL);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		treeViewer.setInput(Arrays.asList(database.isLoaded()?new IWaveformDb[]{database}:new IWaveformDb[]{new LoadingWaveformDb()}));
 | 
							treeViewer.setInput(Arrays.asList(database.isLoaded()?new IWaveformDb[]{database}:new IWaveformDb[]{new LoadingWaveformDb()}));
 | 
				
			||||||
@@ -438,7 +470,10 @@ public class DesignBrowser {
 | 
				
			|||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			IWaveform p = (IWaveform) element;
 | 
								IWaveform p = (IWaveform) element;
 | 
				
			||||||
			if (p.getName().matches(searchString)) {
 | 
								try {
 | 
				
			||||||
 | 
									if (p.getName().matches(searchString))
 | 
				
			||||||
 | 
										return true;
 | 
				
			||||||
 | 
								} catch (PatternSyntaxException e) {
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,6 +10,7 @@
 | 
				
			|||||||
 *******************************************************************************/
 | 
					 *******************************************************************************/
 | 
				
			||||||
package com.minres.scviewer.e4.application.parts;
 | 
					package com.minres.scviewer.e4.application.parts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.Vector;
 | 
					import java.util.Vector;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import javax.annotation.PostConstruct;
 | 
					import javax.annotation.PostConstruct;
 | 
				
			||||||
@@ -20,7 +21,9 @@ import org.eclipse.e4.core.di.annotations.Optional;
 | 
				
			|||||||
import org.eclipse.e4.core.services.events.IEventBroker;
 | 
					import org.eclipse.e4.core.services.events.IEventBroker;
 | 
				
			||||||
import org.eclipse.e4.ui.di.Focus;
 | 
					import org.eclipse.e4.ui.di.Focus;
 | 
				
			||||||
import org.eclipse.e4.ui.di.UIEventTopic;
 | 
					import org.eclipse.e4.ui.di.UIEventTopic;
 | 
				
			||||||
 | 
					import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 | 
				
			||||||
import org.eclipse.e4.ui.services.IServiceConstants;
 | 
					import org.eclipse.e4.ui.services.IServiceConstants;
 | 
				
			||||||
 | 
					import org.eclipse.e4.ui.workbench.modeling.EPartService;
 | 
				
			||||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
 | 
					import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
 | 
				
			||||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
 | 
					import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
 | 
				
			||||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 | 
					import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
 | 
				
			||||||
@@ -37,8 +40,8 @@ import org.eclipse.jface.viewers.TreeExpansionEvent;
 | 
				
			|||||||
import org.eclipse.jface.viewers.TreeViewer;
 | 
					import org.eclipse.jface.viewers.TreeViewer;
 | 
				
			||||||
import org.eclipse.jface.viewers.TreeViewerColumn;
 | 
					import org.eclipse.jface.viewers.TreeViewerColumn;
 | 
				
			||||||
import org.eclipse.jface.viewers.Viewer;
 | 
					import org.eclipse.jface.viewers.Viewer;
 | 
				
			||||||
import org.eclipse.jface.viewers.ViewerFilter;
 | 
					 | 
				
			||||||
import org.eclipse.jface.viewers.ViewerComparator;
 | 
					import org.eclipse.jface.viewers.ViewerComparator;
 | 
				
			||||||
 | 
					import org.eclipse.jface.viewers.ViewerFilter;
 | 
				
			||||||
import org.eclipse.swt.SWT;
 | 
					import org.eclipse.swt.SWT;
 | 
				
			||||||
import org.eclipse.swt.events.ControlAdapter;
 | 
					import org.eclipse.swt.events.ControlAdapter;
 | 
				
			||||||
import org.eclipse.swt.events.ControlEvent;
 | 
					import org.eclipse.swt.events.ControlEvent;
 | 
				
			||||||
@@ -55,10 +58,10 @@ import org.eclipse.swt.widgets.Text;
 | 
				
			|||||||
import org.eclipse.swt.widgets.Tree;
 | 
					import org.eclipse.swt.widgets.Tree;
 | 
				
			||||||
import org.eclipse.swt.widgets.TreeItem;
 | 
					import org.eclipse.swt.widgets.TreeItem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.minres.scviewer.database.DataType;
 | 
				
			||||||
import com.minres.scviewer.database.ITx;
 | 
					import com.minres.scviewer.database.ITx;
 | 
				
			||||||
import com.minres.scviewer.database.ITxAttribute;
 | 
					import com.minres.scviewer.database.ITxAttribute;
 | 
				
			||||||
import com.minres.scviewer.database.ITxRelation;
 | 
					import com.minres.scviewer.database.ITxRelation;
 | 
				
			||||||
import com.minres.scviewer.database.DataType;
 | 
					 | 
				
			||||||
import com.minres.scviewer.e4.application.Messages;
 | 
					import com.minres.scviewer.e4.application.Messages;
 | 
				
			||||||
import com.minres.scviewer.e4.application.provider.TxPropertiesLabelProvider;
 | 
					import com.minres.scviewer.e4.application.provider.TxPropertiesLabelProvider;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -118,8 +121,10 @@ public class TransactionDetails {
 | 
				
			|||||||
			public void modifyText(ModifyEvent e) {
 | 
								public void modifyText(ModifyEvent e) {
 | 
				
			||||||
				attributeFilter.setSearchText(((Text) e.widget).getText());
 | 
									attributeFilter.setSearchText(((Text) e.widget).getText());
 | 
				
			||||||
				treeViewer.refresh();
 | 
									treeViewer.refresh();
 | 
				
			||||||
 | 
									treeViewer.expandAll(true);
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		nameFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 | 
							nameFilter.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		attributeFilter = new TxAttributeFilter();
 | 
							attributeFilter = new TxAttributeFilter();
 | 
				
			||||||
@@ -203,7 +208,7 @@ public class TransactionDetails {
 | 
				
			|||||||
						Object[] selectedArray = (Object[]) selected;
 | 
											Object[] selectedArray = (Object[]) selected;
 | 
				
			||||||
						if(selectedArray.length==3 && selectedArray[2] instanceof ITx){
 | 
											if(selectedArray.length==3 && selectedArray[2] instanceof ITx){
 | 
				
			||||||
							waveformViewerPart.setSelection(new StructuredSelection(selectedArray[2]));
 | 
												waveformViewerPart.setSelection(new StructuredSelection(selectedArray[2]));
 | 
				
			||||||
							treeViewer.setInput(selectedArray[2]);
 | 
												setInput(selectedArray[2]);
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
@@ -265,26 +270,86 @@ public class TransactionDetails {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	public void setInput(Object object) {
 | 
						public void setInput(Object object) {
 | 
				
			||||||
		if(object instanceof ITx){
 | 
							if(object instanceof ITx){
 | 
				
			||||||
			TreeItem obj = treeViewer.getTree().getTopItem();
 | 
								ArrayList<String> names = new ArrayList<>();
 | 
				
			||||||
			Rectangle bounds = null;
 | 
								int indexInParent=getTopItemHier(names);
 | 
				
			||||||
			if(obj!=null) bounds=obj.getBounds();
 | 
								ArrayList<Boolean> states = getExpandedState(treeViewer.getTree().getItems());
 | 
				
			||||||
			treeViewer.setInput(object);
 | 
								treeViewer.setInput(object);
 | 
				
			||||||
			if(bounds!=null) {
 | 
								setExpandedState(treeViewer.getTree().getItems(), states);
 | 
				
			||||||
				TreeItem ti =  treeViewer.getTree().getItem (new Point(bounds.x, bounds.y));
 | 
								setTopItemFromHier(names, indexInParent);
 | 
				
			||||||
				if(ti!=null) treeViewer.getTree().setTopItem(ti);
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			treeViewer.setInput(null);
 | 
								treeViewer.setInput(null);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private void setExpandedState(TreeItem[] treeItems, ArrayList<Boolean> states) {
 | 
				
			||||||
 | 
							for (int i = 0; i < treeItems.length; i++) {
 | 
				
			||||||
 | 
								treeItems[i].setExpanded(states.size()>i?states.get(i):true);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						private ArrayList<Boolean> getExpandedState(TreeItem[] items){
 | 
				
			||||||
 | 
							ArrayList<Boolean> ret = new ArrayList<>();
 | 
				
			||||||
 | 
							for (TreeItem treeItem : items)
 | 
				
			||||||
 | 
								ret.add(treeItem.getItemCount()>0?treeItem.getExpanded():true);
 | 
				
			||||||
 | 
							return ret;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private int getTopItemHier(ArrayList<String> names){
 | 
				
			||||||
 | 
							int indexInParent=-1;
 | 
				
			||||||
 | 
							TreeItem obj = treeViewer.getTree().getTopItem();
 | 
				
			||||||
 | 
							if(obj!=null) {
 | 
				
			||||||
 | 
								names.add(0, obj.getText(0));
 | 
				
			||||||
 | 
								if(obj.getParentItem()!=null) {
 | 
				
			||||||
 | 
									TreeItem pobj=obj.getParentItem();
 | 
				
			||||||
 | 
									names.add(0, pobj.getText(0));
 | 
				
			||||||
 | 
									TreeItem[] items = pobj.getItems();
 | 
				
			||||||
 | 
									for (int i = 0; i < items.length; i++) {
 | 
				
			||||||
 | 
										if(items[i]==obj) {
 | 
				
			||||||
 | 
											indexInParent=i;
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							return indexInParent;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						private void setTopItemFromHier(ArrayList<String> names, int indexInParent) {
 | 
				
			||||||
 | 
							if(indexInParent<0 || names.size()==0 ) return;
 | 
				
			||||||
 | 
							TreeItem selItem=null;
 | 
				
			||||||
 | 
							for (TreeItem item : treeViewer.getTree().getItems()) { // find item from category
 | 
				
			||||||
 | 
								if(item.getText(0).equals(names.get(0))) {
 | 
				
			||||||
 | 
									if(names.size()>1) { // if we had an attribute as top item
 | 
				
			||||||
 | 
										TreeItem[] subItems=item.getItems();
 | 
				
			||||||
 | 
										for(TreeItem it : subItems) { // try to align by name
 | 
				
			||||||
 | 
											if(it.getText(0).equals(names.get(1))) {
 | 
				
			||||||
 | 
												selItem=it;
 | 
				
			||||||
 | 
												break;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										if(selItem==null && indexInParent>=0 && subItems.length>0) // name based match failed so try to use position
 | 
				
			||||||
 | 
											selItem=subItems[subItems.length>indexInParent?indexInParent:subItems.length-1];
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									if(selItem==null) // no match in attributes so set the category as top item
 | 
				
			||||||
 | 
										selItem=item;
 | 
				
			||||||
 | 
									break;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if(selItem!=null)
 | 
				
			||||||
 | 
								treeViewer.getTree().setTopItem(selItem);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
	 * Sets the selection.
 | 
						 * Sets the selection.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * @param selection the new selection
 | 
						 * @param selection the new selection
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	@Inject
 | 
						@Inject
 | 
				
			||||||
	public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection){
 | 
						public void setSelection(@Named(IServiceConstants.ACTIVE_SELECTION) @Optional IStructuredSelection selection, EPartService partService){
 | 
				
			||||||
 | 
							// only react if selection is actually from the WaveformViewer and nothing else
 | 
				
			||||||
 | 
							MPart part = partService.getActivePart();
 | 
				
			||||||
 | 
							if( part == null || ! (part.getObject() instanceof WaveformViewer ) )
 | 
				
			||||||
 | 
								return;
 | 
				
			||||||
		if(treeViewer!=null && selection!=null && !treeViewer.getTree().isDisposed()){
 | 
							if(treeViewer!=null && selection!=null && !treeViewer.getTree().isDisposed()){
 | 
				
			||||||
			if( selection instanceof IStructuredSelection) {
 | 
								if( selection instanceof IStructuredSelection) {
 | 
				
			||||||
				setInput(((IStructuredSelection)selection).getFirstElement());		
 | 
									setInput(((IStructuredSelection)selection).getFirstElement());		
 | 
				
			||||||
@@ -404,16 +469,20 @@ public class TransactionDetails {
 | 
				
			|||||||
		 */
 | 
							 */
 | 
				
			||||||
		@Override
 | 
							@Override
 | 
				
			||||||
		public boolean select(Viewer viewer, Object parentElement, Object element) {
 | 
							public boolean select(Viewer viewer, Object parentElement, Object element) {
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			if (searchString == null || searchString.length() == 0) {
 | 
								if (searchString == null || searchString.length() == 0) {
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if(element instanceof ITxAttribute){
 | 
								if(element instanceof TreeNode) {
 | 
				
			||||||
				ITxAttribute p = (ITxAttribute) element;
 | 
					 | 
				
			||||||
				if (p.getName().matches(searchString)) {
 | 
					 | 
				
			||||||
					return true;
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
			} else if(element instanceof TreeNode)
 | 
					 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								if(element instanceof ITxAttribute){
 | 
				
			||||||
 | 
									return (((ITxAttribute) element).getName().toLowerCase().matches(searchString.toLowerCase())); 
 | 
				
			||||||
 | 
								} 
 | 
				
			||||||
 | 
								if(element instanceof Object[]) {
 | 
				
			||||||
 | 
									return (((Object[])element)[0]).toString().toLowerCase().matches(searchString.toLowerCase());	
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,6 +63,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 | 
				
			|||||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
 | 
					import org.eclipse.jface.viewers.SelectionChangedEvent;
 | 
				
			||||||
import org.eclipse.jface.viewers.StructuredSelection;
 | 
					import org.eclipse.jface.viewers.StructuredSelection;
 | 
				
			||||||
import org.eclipse.swt.SWT;
 | 
					import org.eclipse.swt.SWT;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeEvent;
 | 
				
			||||||
 | 
					import org.eclipse.swt.events.DisposeListener;
 | 
				
			||||||
import org.eclipse.swt.events.MouseEvent;
 | 
					import org.eclipse.swt.events.MouseEvent;
 | 
				
			||||||
import org.eclipse.swt.events.MouseTrackListener;
 | 
					import org.eclipse.swt.events.MouseTrackListener;
 | 
				
			||||||
import org.eclipse.swt.events.MouseWheelListener;
 | 
					import org.eclipse.swt.events.MouseWheelListener;
 | 
				
			||||||
@@ -72,8 +74,10 @@ import org.eclipse.swt.widgets.Composite;
 | 
				
			|||||||
import org.eclipse.swt.widgets.Display;
 | 
					import org.eclipse.swt.widgets.Display;
 | 
				
			||||||
import org.eclipse.swt.widgets.Event;
 | 
					import org.eclipse.swt.widgets.Event;
 | 
				
			||||||
import org.eclipse.swt.widgets.Listener;
 | 
					import org.eclipse.swt.widgets.Listener;
 | 
				
			||||||
 | 
					import org.eclipse.swt.widgets.MessageBox;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.minres.scviewer.database.ITx;
 | 
					import com.minres.scviewer.database.ITx;
 | 
				
			||||||
 | 
					import com.minres.scviewer.database.ITxEvent;
 | 
				
			||||||
import com.minres.scviewer.database.ITxRelation;
 | 
					import com.minres.scviewer.database.ITxRelation;
 | 
				
			||||||
import com.minres.scviewer.database.IWaveform;
 | 
					import com.minres.scviewer.database.IWaveform;
 | 
				
			||||||
import com.minres.scviewer.database.IWaveformDb;
 | 
					import com.minres.scviewer.database.IWaveformDb;
 | 
				
			||||||
@@ -100,7 +104,7 @@ import com.minres.scviewer.e4.application.preferences.PreferenceConstants;
 | 
				
			|||||||
 * The Class WaveformViewerPart.
 | 
					 * The Class WaveformViewerPart.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@SuppressWarnings("restriction")
 | 
					@SuppressWarnings("restriction")
 | 
				
			||||||
public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener {
 | 
					public class WaveformViewer implements IFileChangeListener, IPreferenceChangeListener, DisposeListener {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** The Constant ACTIVE_WAVEFORMVIEW. */
 | 
						/** The Constant ACTIVE_WAVEFORMVIEW. */
 | 
				
			||||||
	public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; //$NON-NLS-1$
 | 
						public static final String ACTIVE_WAVEFORMVIEW = "Active_Waveform_View"; //$NON-NLS-1$
 | 
				
			||||||
@@ -127,6 +131,15 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	/** The Constant BASE_LINE_TIME. */
 | 
						/** The Constant BASE_LINE_TIME. */
 | 
				
			||||||
	protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
 | 
						protected static final String BASE_LINE_TIME = "BASE_LINE_TIME"; //$NON-NLS-1$
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						/** The Constant SELECTED_TX_ID. */
 | 
				
			||||||
 | 
						protected static final String SELECTED_TX_ID = "SELECTED_TX_ID"; //$NON-NLS-1$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/** The Constant SELECTED_TRACKENTRY_NAME. */
 | 
				
			||||||
 | 
						protected static final String SELECTED_TRACKENTRY_NAME = "SELECTED_TRACKENTRY_NAME"; //$NON-NLS-1$
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						/** The Constant WAVEFORM_SELECTED. */
 | 
				
			||||||
 | 
						protected static final String WAVEFORM_SELECTED = ".WAVEFORM_SELECTED"; //$NON-NLS-1$
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	/** The Constant FILE_CHECK_INTERVAL. */
 | 
						/** The Constant FILE_CHECK_INTERVAL. */
 | 
				
			||||||
	protected static final long FILE_CHECK_INTERVAL = 60000;
 | 
						protected static final long FILE_CHECK_INTERVAL = 60000;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
@@ -139,6 +152,9 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	/** The Constant WAVE_ACTION_ID. */
 | 
						/** The Constant WAVE_ACTION_ID. */
 | 
				
			||||||
	public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; //$NON-NLS-1$
 | 
						public static final String WAVE_ACTION_ID = "com.minres.scviewer.ui.action.AddToWave"; //$NON-NLS-1$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/** The number of active DisposeListeners */
 | 
				
			||||||
 | 
						private static int disposeListenerNumber = 0;
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	/** The factory. */
 | 
						/** The factory. */
 | 
				
			||||||
	WaveformViewerFactory factory = new WaveformViewerFactory();
 | 
						WaveformViewerFactory factory = new WaveformViewerFactory();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -169,6 +185,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE)
 | 
						@Preference(nodePath = PreferenceConstants.PREFERENCES_SCOPE)
 | 
				
			||||||
	IEclipsePreferences prefs;
 | 
						IEclipsePreferences prefs;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						@Inject @Optional DesignBrowser designBrowser;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/** The database. */
 | 
						/** The database. */
 | 
				
			||||||
	private IWaveformDb database;
 | 
						private IWaveformDb database;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -211,6 +229,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	@PostConstruct
 | 
						@PostConstruct
 | 
				
			||||||
	public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
 | 
						public void createComposite(MPart part, Composite parent, IWaveformDbFactory dbFactory) {
 | 
				
			||||||
 | 
							disposeListenerNumber += 1;
 | 
				
			||||||
 | 
									
 | 
				
			||||||
		myPart = part;
 | 
							myPart = part;
 | 
				
			||||||
		myParent = parent;
 | 
							myParent = parent;
 | 
				
			||||||
		database = dbFactory.getDatabase();
 | 
							database = dbFactory.getDatabase();
 | 
				
			||||||
@@ -229,6 +249,10 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		});
 | 
							});
 | 
				
			||||||
		waveformPane = factory.createPanel(parent);
 | 
							waveformPane = factory.createPanel(parent);
 | 
				
			||||||
		waveformPane.setMaxTime(0);
 | 
							waveformPane.setMaxTime(0);
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							//set selection to empty selection when opening a new waveformPane
 | 
				
			||||||
 | 
							selectionService.setSelection(new StructuredSelection());
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
 | 
							waveformPane.addPropertyChangeListener(IWaveformViewer.CURSOR_PROPERTY, new PropertyChangeListener() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public void propertyChange(PropertyChangeEvent evt) {
 | 
								public void propertyChange(PropertyChangeEvent evt) {
 | 
				
			||||||
@@ -248,11 +272,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
				eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
 | 
									eventBroker.post(WaveStatusBarControl.MARKER_DIFF, waveformPane.getScaledTime(cursor - time));
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		waveformPane.addSelectionChangedListener(new ISelectionChangedListener() {
 | 
							waveformPane.addSelectionChangedListener(new ISelectionChangedListener() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public void selectionChanged(SelectionChangedEvent event) {
 | 
								public void selectionChanged(SelectionChangedEvent event) {
 | 
				
			||||||
				if (event.getSelection() instanceof IStructuredSelection)
 | 
									if (event.getSelection() instanceof IStructuredSelection) {
 | 
				
			||||||
					selectionService.setSelection(event.getSelection());
 | 
										selectionService.setSelection(event.getSelection());
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		waveformPane.getWaveformControl().addMouseTrackListener(new MouseTrackListener() {
 | 
							waveformPane.getWaveformControl().addMouseTrackListener(new MouseTrackListener() {
 | 
				
			||||||
@@ -383,6 +409,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		prefs.addPreferenceChangeListener(this);
 | 
							prefs.addPreferenceChangeListener(this);
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							waveformPane.addDisposeListener(this);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* (non-Javadoc)
 | 
						/* (non-Javadoc)
 | 
				
			||||||
@@ -468,7 +496,17 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		job.addJobChangeListener(new JobChangeAdapter() {
 | 
							job.addJobChangeListener(new JobChangeAdapter() {
 | 
				
			||||||
			@Override
 | 
								@Override
 | 
				
			||||||
			public void done(IJobChangeEvent event) {
 | 
								public void done(IJobChangeEvent event) {
 | 
				
			||||||
				if (event.getResult().getCode() != Status.OK_STATUS.getCode()) return;
 | 
									IStatus result = event.getResult();
 | 
				
			||||||
 | 
									if( (!result.isMultiStatus() && result.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);
 | 
				
			||||||
 | 
										});
 | 
				
			||||||
 | 
										return;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				sync.asyncExec(()->{
 | 
									sync.asyncExec(()->{
 | 
				
			||||||
					waveformPane.setMaxTime(database.getMaxTime());
 | 
										waveformPane.setMaxTime(database.getMaxTime());
 | 
				
			||||||
					if (state != null)
 | 
										if (state != null)
 | 
				
			||||||
@@ -578,6 +616,8 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public void saveState(String fileName){
 | 
						public void saveState(String fileName){
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
									
 | 
				
			||||||
		Map<String, String> persistedState = new HashMap<>();
 | 
							Map<String, String> persistedState = new HashMap<>();
 | 
				
			||||||
		persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$
 | 
							persistedState.put(DATABASE_FILE + "S", Integer.toString(filesToLoad.size())); //$NON-NLS-1$
 | 
				
			||||||
		Integer index = 0;
 | 
							Integer index = 0;
 | 
				
			||||||
@@ -588,10 +628,14 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		saveWaveformViewerState(persistedState);
 | 
							saveWaveformViewerState(persistedState);
 | 
				
			||||||
		Properties props = new Properties();
 | 
							Properties props = new Properties();
 | 
				
			||||||
		props.putAll(persistedState);
 | 
							props.putAll(persistedState);
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			FileOutputStream out = new FileOutputStream(fileName);
 | 
								
 | 
				
			||||||
			props.store(out, "Written by SCViewer"); //$NON-NLS-1$
 | 
									FileOutputStream out = new FileOutputStream(fileName);
 | 
				
			||||||
			out.close();
 | 
					                props.store(out, "Written by SCViewer"); //$NON-NLS-1$
 | 
				
			||||||
 | 
								    out.close();
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								
 | 
				
			||||||
		} catch (IOException e) {
 | 
							} catch (IOException e) {
 | 
				
			||||||
			e.printStackTrace();
 | 
								e.printStackTrace();
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -600,6 +644,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	public void loadState(String fileName){
 | 
						public void loadState(String fileName){
 | 
				
			||||||
		Properties props = new Properties();
 | 
							Properties props = new Properties();
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
 | 
								//clear old streams before loading tab settings
 | 
				
			||||||
 | 
								if(!waveformPane.getStreamList().isEmpty()) {
 | 
				
			||||||
 | 
									waveformPane.getStreamList().clear();
 | 
				
			||||||
 | 
									for (TrackEntry trackEntry : waveformPane.getStreamList()) {
 | 
				
			||||||
 | 
										trackEntry.selected = false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			FileInputStream in = new FileInputStream(fileName);
 | 
								FileInputStream in = new FileInputStream(fileName);
 | 
				
			||||||
			props.load(in);
 | 
								props.load(in);
 | 
				
			||||||
			in.close();
 | 
								in.close();
 | 
				
			||||||
@@ -619,12 +670,15 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	protected void saveWaveformViewerState(Map<String, String> persistedState) {
 | 
						protected void saveWaveformViewerState(Map<String, String> persistedState) {
 | 
				
			||||||
		Integer index;
 | 
							Integer index;
 | 
				
			||||||
 | 
							boolean isStream = false;
 | 
				
			||||||
		persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); //$NON-NLS-1$
 | 
							persistedState.put(SHOWN_WAVEFORM + "S", Integer.toString(waveformPane.getStreamList().size())); //$NON-NLS-1$
 | 
				
			||||||
		index = 0;
 | 
							index = 0;
 | 
				
			||||||
		for (TrackEntry trackEntry : waveformPane.getStreamList()) {
 | 
							for (TrackEntry trackEntry : waveformPane.getStreamList()) {
 | 
				
			||||||
 | 
								if(trackEntry.isStream()) { isStream=true; }
 | 
				
			||||||
			persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName());
 | 
								persistedState.put(SHOWN_WAVEFORM + index, trackEntry.waveform.getFullName());
 | 
				
			||||||
			persistedState.put(SHOWN_WAVEFORM + index + VALUE_DISPLAY, trackEntry.valueDisplay.toString());
 | 
								persistedState.put(SHOWN_WAVEFORM + index + VALUE_DISPLAY, trackEntry.valueDisplay.toString());
 | 
				
			||||||
			persistedState.put(SHOWN_WAVEFORM + index + WAVE_DISPLAY, trackEntry.waveDisplay.toString());
 | 
								persistedState.put(SHOWN_WAVEFORM + index + WAVE_DISPLAY, trackEntry.waveDisplay.toString());
 | 
				
			||||||
 | 
								persistedState.put(SHOWN_WAVEFORM + index + WAVEFORM_SELECTED, String.valueOf(trackEntry.selected).toUpperCase());
 | 
				
			||||||
			index++;
 | 
								index++;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		List<ICursor> cursors = waveformPane.getCursorList();
 | 
							List<ICursor> cursors = waveformPane.getCursorList();
 | 
				
			||||||
@@ -636,6 +690,36 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		persistedState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
 | 
							persistedState.put(ZOOM_LEVEL, Integer.toString(waveformPane.getZoomLevel()));
 | 
				
			||||||
		persistedState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
 | 
							persistedState.put(BASE_LINE_TIME, Long.toString(waveformPane.getBaselineTime()));
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// get selected transaction	of a stream	
 | 
				
			||||||
 | 
							ISelection selection = waveformPane.getSelection();
 | 
				
			||||||
 | 
							if (!selection.isEmpty() && isStream) {
 | 
				
			||||||
 | 
								List<Object> t = getISelection(selection);
 | 
				
			||||||
 | 
								ITx tx = (ITx) t.get(0);
 | 
				
			||||||
 | 
								TrackEntry te = (TrackEntry) t.get(1);
 | 
				
			||||||
 | 
								// get transaction id
 | 
				
			||||||
 | 
								persistedState.put(SELECTED_TX_ID, Long.toString(tx.getId()));
 | 
				
			||||||
 | 
								//get TrackEntry name
 | 
				
			||||||
 | 
								String name = te.getStream().getFullName();
 | 
				
			||||||
 | 
								persistedState.put(SELECTED_TRACKENTRY_NAME, name);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						protected List<Object> getISelection(ISelection selection){
 | 
				
			||||||
 | 
						    List<Object> result = new LinkedList<Object> ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						    if ( selection instanceof IStructuredSelection )
 | 
				
			||||||
 | 
						    {
 | 
				
			||||||
 | 
						        Iterator<?> i = ((IStructuredSelection)selection).iterator();
 | 
				
			||||||
 | 
						        while (i.hasNext()){
 | 
				
			||||||
 | 
						            Object o = i.next ();
 | 
				
			||||||
 | 
						            if (o == null) {
 | 
				
			||||||
 | 
						                continue;
 | 
				
			||||||
 | 
						            }
 | 
				
			||||||
 | 
						            result.add(o);
 | 
				
			||||||
 | 
						        }
 | 
				
			||||||
 | 
						    }
 | 
				
			||||||
 | 
						    return result;
 | 
				
			||||||
	}	
 | 
						}	
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
@@ -650,6 +734,13 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
			IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
 | 
								IWaveform waveform = database.getStreamByName(state.get(SHOWN_WAVEFORM + i));
 | 
				
			||||||
			if (waveform != null) {
 | 
								if (waveform != null) {
 | 
				
			||||||
				TrackEntry t = new TrackEntry(waveform);
 | 
									TrackEntry t = new TrackEntry(waveform);
 | 
				
			||||||
 | 
									//check if t is selected
 | 
				
			||||||
 | 
									boolean isSelected = Boolean.valueOf(state.get(SHOWN_WAVEFORM + i + WAVEFORM_SELECTED));
 | 
				
			||||||
 | 
									if(isSelected) {
 | 
				
			||||||
 | 
										t.selected = true;
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										t.selected = false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
				res.add(t);
 | 
									res.add(t);
 | 
				
			||||||
				String v = state.get(SHOWN_WAVEFORM + i + VALUE_DISPLAY);
 | 
									String v = state.get(SHOWN_WAVEFORM + i + VALUE_DISPLAY);
 | 
				
			||||||
				if(v!=null)
 | 
									if(v!=null)
 | 
				
			||||||
@@ -683,6 +774,38 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
			} catch (NumberFormatException e) {
 | 
								} catch (NumberFormatException e) {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if (state.containsKey(SELECTED_TX_ID) && state.containsKey(SELECTED_TRACKENTRY_NAME)) {
 | 
				
			||||||
 | 
								try {
 | 
				
			||||||
 | 
									Long txId = Long.parseLong(state.get(SELECTED_TX_ID));
 | 
				
			||||||
 | 
									String trackentryName = state.get(SELECTED_TRACKENTRY_NAME);
 | 
				
			||||||
 | 
									
 | 
				
			||||||
 | 
									//get TrackEntry Object based on name and TX Object by id and put into selectionList
 | 
				
			||||||
 | 
									for(TrackEntry te : res) {
 | 
				
			||||||
 | 
										if(te.waveform.getFullName().compareTo(trackentryName)==0) {
 | 
				
			||||||
 | 
											boolean found = false;
 | 
				
			||||||
 | 
											// TODO: find transaction by time? To avoid 3x for-loop
 | 
				
			||||||
 | 
											for( List<ITxEvent> lev : te.getStream().getEvents().values() ) {
 | 
				
			||||||
 | 
												if(lev == null) continue;
 | 
				
			||||||
 | 
												for(ITxEvent itxe : lev) {
 | 
				
			||||||
 | 
													if(itxe == null) continue;
 | 
				
			||||||
 | 
													ITx itx = itxe.getTransaction();
 | 
				
			||||||
 | 
													if(itx.getId() == txId) {
 | 
				
			||||||
 | 
														found = true;
 | 
				
			||||||
 | 
														ArrayList<Object> selectionList = new ArrayList<Object>();
 | 
				
			||||||
 | 
														selectionList.add(te);
 | 
				
			||||||
 | 
														selectionList.add(itx);
 | 
				
			||||||
 | 
														waveformPane.setSelection(new StructuredSelection (selectionList));
 | 
				
			||||||
 | 
														break;
 | 
				
			||||||
 | 
													}
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
												if(found) break;
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
											break;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								} catch (NumberFormatException e) {
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		updateAll();
 | 
							updateAll();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -826,14 +949,26 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		List<TrackEntry> streams = waveformPane.getStreamList();
 | 
							List<TrackEntry> streams = waveformPane.getStreamList();
 | 
				
			||||||
		ISelection sel = waveformPane.getSelection();
 | 
							ISelection sel = waveformPane.getSelection();
 | 
				
			||||||
		TrackEntry newSelection=null;
 | 
							TrackEntry newSelection=null;
 | 
				
			||||||
 | 
							
 | 
				
			||||||
		if(sel instanceof IStructuredSelection && ((IStructuredSelection) sel).size()==2) {
 | 
							if(sel instanceof IStructuredSelection && ((IStructuredSelection) sel).size()==2) {
 | 
				
			||||||
				Iterator<?> it = ((IStructuredSelection)sel).iterator();
 | 
									Iterator<?> it = ((IStructuredSelection)sel).iterator();
 | 
				
			||||||
				it.next();
 | 
									it.next();
 | 
				
			||||||
				int idx = streams.indexOf(it.next());
 | 
									int idx = streams.indexOf(it.next());
 | 
				
			||||||
				if(idx==streams.size()-1)
 | 
									
 | 
				
			||||||
					newSelection=streams.get(idx-1);
 | 
									if(idx==streams.size()-1) {
 | 
				
			||||||
				else
 | 
										//last stream gets deleted, no more selection
 | 
				
			||||||
 | 
										if(idx==0) {
 | 
				
			||||||
 | 
											newSelection=null;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										//more than 1 stream left, last gets deleted, selection jumps to new last stream
 | 
				
			||||||
 | 
										else {
 | 
				
			||||||
 | 
											newSelection=streams.get(idx-1);
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									//more than 1 stream left, any stream but the last gets deleted, selection jumps to the next stream
 | 
				
			||||||
 | 
									else {
 | 
				
			||||||
					newSelection=streams.get(idx+1);
 | 
										newSelection=streams.get(idx+1);
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		waveformPane.setSelection(new StructuredSelection());
 | 
							waveformPane.setSelection(new StructuredSelection());
 | 
				
			||||||
		streams.remove(trackEntry);
 | 
							streams.remove(trackEntry);
 | 
				
			||||||
@@ -1078,4 +1213,28 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis
 | 
				
			|||||||
		waveformPane.update();
 | 
							waveformPane.update();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * add dispose listener
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 * @param listener
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						public void addDisposeListener (DisposeListener listener) {
 | 
				
			||||||
 | 
							waveformPane.getControl().addDisposeListener(listener);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/**
 | 
				
			||||||
 | 
						 * triggers included actions if widget is disposed
 | 
				
			||||||
 | 
						 * 
 | 
				
			||||||
 | 
						 * @param e
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
					    public void widgetDisposed(DisposeEvent e) {
 | 
				
			||||||
 | 
					    	disposeListenerNumber -= 1;
 | 
				
			||||||
 | 
					    	if( disposeListenerNumber == 0) {  //if the last tab is closed, reset statusbar
 | 
				
			||||||
 | 
								eventBroker.post(WaveStatusBarControl.ZOOM_LEVEL, null);
 | 
				
			||||||
 | 
								eventBroker.post(WaveStatusBarControl.CURSOR_TIME, null);
 | 
				
			||||||
 | 
								eventBroker.post(WaveStatusBarControl.MARKER_TIME, null);
 | 
				
			||||||
 | 
								eventBroker.post(WaveStatusBarControl.MARKER_DIFF, null);
 | 
				
			||||||
 | 
					    	}
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
		<relativePath>../com.minres.scviewer.parent</relativePath>
 | 
							<relativePath>../com.minres.scviewer.parent</relativePath>
 | 
				
			||||||
	</parent>
 | 
						</parent>
 | 
				
			||||||
	<artifactId>com.minres.scviewer.e4.product</artifactId>
 | 
						<artifactId>com.minres.scviewer.e4.product</artifactId>
 | 
				
			||||||
  	<version>2.0.2-SNAPSHOT</version>
 | 
					  	<version>2.1.4-SNAPSHOT</version>
 | 
				
			||||||
	<packaging>eclipse-repository</packaging>
 | 
						<packaging>eclipse-repository</packaging>
 | 
				
			||||||
	<groupId>com.minres.scviewer</groupId>
 | 
						<groupId>com.minres.scviewer</groupId>
 | 
				
			||||||
	<build>
 | 
						<build>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
<?pde version="3.5"?>
 | 
					<?pde version="3.5"?>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<product name="SCViewer" uid="scviewer" id="com.minres.scviewer.e4.application.product" application="org.eclipse.e4.ui.workbench.swt.E4Application" version="2.0.2.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.1.4.qualifier" useFeatures="false" includeLaunchers="true">
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   <configIni use="default">
 | 
					   <configIni use="default">
 | 
				
			||||||
   </configIni>
 | 
					   </configIni>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
@@ -1,4 +1,5 @@
 | 
				
			|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 | 
					<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">
 | 
						xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 | 
				
			||||||
	<modelVersion>4.0.0</modelVersion>
 | 
						<modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
	<groupId>com.minres.scviewer</groupId>
 | 
						<groupId>com.minres.scviewer</groupId>
 | 
				
			||||||
@@ -24,25 +25,10 @@
 | 
				
			|||||||
	</modules>
 | 
						</modules>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<properties>
 | 
						<properties>
 | 
				
			||||||
		<tycho-version>0.23.1</tycho-version>
 | 
							<tycho-version>1.5.0</tycho-version>
 | 
				
			||||||
		<tycho-extras-version>${tycho-version}</tycho-extras-version>
 | 
							<groovy-eclipse-compiler-version>3.5.0</groovy-eclipse-compiler-version>
 | 
				
			||||||
		<groovy-eclipse-compiler-version>2.8.0-01</groovy-eclipse-compiler-version>
 | 
							<groovy-eclipse-batch-version>2.5.8-03</groovy-eclipse-batch-version>
 | 
				
			||||||
		<!-- <groovy-eclipse-batch-version>2.0.5</groovy-eclipse-batch-version> -->
 | 
					 | 
				
			||||||
		<groovy-eclipse-batch-version>2.1.8-01</groovy-eclipse-batch-version>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	</properties>
 | 
						</properties>
 | 
				
			||||||
	<repositories>
 | 
					 | 
				
			||||||
		<repository>
 | 
					 | 
				
			||||||
			<id>mars</id>
 | 
					 | 
				
			||||||
			<layout>p2</layout>
 | 
					 | 
				
			||||||
			<url>http://download.eclipse.org/releases/photon</url>
 | 
					 | 
				
			||||||
		</repository>
 | 
					 | 
				
			||||||
		<repository>
 | 
					 | 
				
			||||||
			<id>GRECLIPSE</id>
 | 
					 | 
				
			||||||
			<layout>p2</layout>
 | 
					 | 
				
			||||||
			<url>http://dist.springsource.org/snapshot/GRECLIPSE/e4.8</url>
 | 
					 | 
				
			||||||
		</repository>
 | 
					 | 
				
			||||||
	</repositories>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<build>
 | 
						<build>
 | 
				
			||||||
		<plugins>
 | 
							<plugins>
 | 
				
			||||||
@@ -53,11 +39,54 @@
 | 
				
			|||||||
				<extensions>true</extensions>
 | 
									<extensions>true</extensions>
 | 
				
			||||||
			</plugin>
 | 
								</plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<plugin>
 | 
				
			||||||
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
 | 
									<artifactId>tycho-source-plugin</artifactId>
 | 
				
			||||||
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<executions>
 | 
				
			||||||
 | 
										<execution>
 | 
				
			||||||
 | 
											<id>plugin-source</id>
 | 
				
			||||||
 | 
											<goals>
 | 
				
			||||||
 | 
												<goal>plugin-source</goal>
 | 
				
			||||||
 | 
											</goals>
 | 
				
			||||||
 | 
										</execution>
 | 
				
			||||||
 | 
									</executions>
 | 
				
			||||||
 | 
								</plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<plugin>
 | 
				
			||||||
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
 | 
									<artifactId>tycho-p2-plugin</artifactId>
 | 
				
			||||||
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
 | 
									<executions>
 | 
				
			||||||
 | 
										<execution>
 | 
				
			||||||
 | 
											<id>attach-p2-metadata</id>
 | 
				
			||||||
 | 
											<phase>package</phase>
 | 
				
			||||||
 | 
											<goals>
 | 
				
			||||||
 | 
												<goal>p2-metadata</goal>
 | 
				
			||||||
 | 
											</goals>
 | 
				
			||||||
 | 
										</execution>
 | 
				
			||||||
 | 
									</executions>
 | 
				
			||||||
 | 
								</plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<plugin>
 | 
				
			||||||
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
 | 
									<artifactId>tycho-versions-plugin</artifactId>
 | 
				
			||||||
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
 | 
								</plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<plugin>
 | 
								<plugin>
 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
									<groupId>org.eclipse.tycho</groupId>
 | 
				
			||||||
				<artifactId>target-platform-configuration</artifactId>
 | 
									<artifactId>target-platform-configuration</artifactId>
 | 
				
			||||||
				<version>${tycho-version}</version>
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
				<configuration>
 | 
									<configuration>
 | 
				
			||||||
 | 
										<target>
 | 
				
			||||||
 | 
											<artifact>
 | 
				
			||||||
 | 
												<groupId>com.minres.scviewer</groupId>
 | 
				
			||||||
 | 
												<artifactId>com.minres.scviewer.target</artifactId>
 | 
				
			||||||
 | 
												<version>2.0.0-SNAPSHOT</version>
 | 
				
			||||||
 | 
											</artifact>
 | 
				
			||||||
 | 
										</target>
 | 
				
			||||||
					<environments>
 | 
										<environments>
 | 
				
			||||||
						<environment>
 | 
											<environment>
 | 
				
			||||||
							<os>linux</os>
 | 
												<os>linux</os>
 | 
				
			||||||
@@ -91,7 +120,7 @@
 | 
				
			|||||||
			<plugin>
 | 
								<plugin>
 | 
				
			||||||
				<groupId>org.eclipse.tycho.extras</groupId>
 | 
									<groupId>org.eclipse.tycho.extras</groupId>
 | 
				
			||||||
				<artifactId>tycho-source-feature-plugin</artifactId>
 | 
									<artifactId>tycho-source-feature-plugin</artifactId>
 | 
				
			||||||
				<version>${tycho-extras-version}</version>
 | 
									<version>${tycho-version}</version>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				<executions>
 | 
									<executions>
 | 
				
			||||||
					<execution>
 | 
										<execution>
 | 
				
			||||||
@@ -111,41 +140,6 @@
 | 
				
			|||||||
				</configuration>
 | 
									</configuration>
 | 
				
			||||||
			</plugin>
 | 
								</plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<plugin>
 | 
					 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
					 | 
				
			||||||
				<artifactId>tycho-source-plugin</artifactId>
 | 
					 | 
				
			||||||
				<version>${tycho-version}</version>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
				<executions>
 | 
					 | 
				
			||||||
					<execution>
 | 
					 | 
				
			||||||
						<id>plugin-source</id>
 | 
					 | 
				
			||||||
						<goals>
 | 
					 | 
				
			||||||
							<goal>plugin-source</goal>
 | 
					 | 
				
			||||||
						</goals>
 | 
					 | 
				
			||||||
					</execution>
 | 
					 | 
				
			||||||
				</executions>
 | 
					 | 
				
			||||||
			</plugin>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			<plugin>
 | 
					 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
					 | 
				
			||||||
				<artifactId>tycho-p2-plugin</artifactId>
 | 
					 | 
				
			||||||
				<version>${tycho-version}</version>
 | 
					 | 
				
			||||||
				<executions>
 | 
					 | 
				
			||||||
					<execution>
 | 
					 | 
				
			||||||
						<id>attached-p2-metadata</id>
 | 
					 | 
				
			||||||
						<phase>package</phase>
 | 
					 | 
				
			||||||
						<goals>
 | 
					 | 
				
			||||||
							<goal>p2-metadata</goal>
 | 
					 | 
				
			||||||
						</goals>
 | 
					 | 
				
			||||||
					</execution>
 | 
					 | 
				
			||||||
				</executions>
 | 
					 | 
				
			||||||
			</plugin>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			<plugin>
 | 
					 | 
				
			||||||
				<groupId>org.eclipse.tycho</groupId>
 | 
					 | 
				
			||||||
				<artifactId>tycho-versions-plugin</artifactId>
 | 
					 | 
				
			||||||
				<version>${tycho-version}</version>
 | 
					 | 
				
			||||||
			</plugin>
 | 
					 | 
				
			||||||
		</plugins>
 | 
							</plugins>
 | 
				
			||||||
	</build>
 | 
						</build>
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
@@ -1,4 +1,6 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Photon Platform" sequenceNumber="138">
 | 
					<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 | 
				
			||||||
 | 
					<?pde version="3.8"?>
 | 
				
			||||||
 | 
					<target name="com.minres.scviewer.target" sequenceNumber="138">
 | 
				
			||||||
<locations>
 | 
					<locations>
 | 
				
			||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
					<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
				
			||||||
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
 | 
					<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
 | 
				
			||||||
@@ -11,8 +13,9 @@
 | 
				
			|||||||
<repository location="http://download.eclipse.org/releases/photon"/>
 | 
					<repository location="http://download.eclipse.org/releases/photon"/>
 | 
				
			||||||
</location>
 | 
					</location>
 | 
				
			||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
					<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
				
			||||||
<unit id="org.codehaus.groovy24.feature.feature.group" version="0.0.0"/>
 | 
					<unit id="org.codehaus.groovy24.feature.feature.group" version="3.5.1.v201909291550-e48"/>
 | 
				
			||||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.8/"/>
 | 
					<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.8/"/>
 | 
				
			||||||
 | 
						<unit id="org.codehaus.groovy25.feature.feature.group" version="3.5.1.v201909291550-e48"/>
 | 
				
			||||||
</location>
 | 
					</location>
 | 
				
			||||||
</locations>
 | 
					</locations>
 | 
				
			||||||
<environment>
 | 
					<environment>
 | 
				
			||||||
@@ -1,22 +0,0 @@
 | 
				
			|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Neon Platform" sequenceNumber="138">
 | 
					 | 
				
			||||||
<locations>
 | 
					 | 
				
			||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
					 | 
				
			||||||
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.300.v20161122-1740"/>
 | 
					 | 
				
			||||||
<unit id="org.eclipse.platform.sdk" version="4.6.2.M20161124-1400"/>
 | 
					 | 
				
			||||||
<unit id="org.eclipse.rcp.sdk.id" version="4.6.2.M20161124-1400"/>
 | 
					 | 
				
			||||||
<unit id="org.eclipse.rcptt.core.feature.group" version="2.1.0.201604261352"/>
 | 
					 | 
				
			||||||
<repository location="http://download.eclipse.org/releases/neon"/>
 | 
					 | 
				
			||||||
</location>
 | 
					 | 
				
			||||||
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
 | 
					 | 
				
			||||||
<unit id="org.codehaus.groovy24.feature.feature.group" version="2.9.3.xx-201806261157-e46"/>
 | 
					 | 
				
			||||||
<repository location="http://dist.springsource.org/snapshot/GRECLIPSE/e4.6"/>
 | 
					 | 
				
			||||||
</location>
 | 
					 | 
				
			||||||
</locations>
 | 
					 | 
				
			||||||
<environment>
 | 
					 | 
				
			||||||
<arch>x86_64</arch>
 | 
					 | 
				
			||||||
<nl>de_DE</nl>
 | 
					 | 
				
			||||||
</environment>
 | 
					 | 
				
			||||||
<launcherArgs>
 | 
					 | 
				
			||||||
<vmArgs>-Dosgi.requiredJavaVersion=1.7 -XX:MaxPermSize=256 -Xms40m -Xmx2G </vmArgs>
 | 
					 | 
				
			||||||
</launcherArgs>
 | 
					 | 
				
			||||||
</target>
 | 
					 | 
				
			||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 | 
						xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 | 
				
			||||||
	<modelVersion>4.0.0</modelVersion>
 | 
						<modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<artifactId>photon</artifactId>
 | 
						<artifactId>com.minres.scviewer.target</artifactId>
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	<packaging>eclipse-target-definition</packaging>
 | 
						<packaging>eclipse-target-definition</packaging>
 | 
				
			||||||
	<name>SCViewer Target Definition</name>
 | 
						<name>SCViewer Target Definition</name>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,6 @@
 | 
				
			|||||||
<classpath>
 | 
					<classpath>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
						<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
 | 
				
			||||||
	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
						<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 | 
				
			||||||
	<classpathentry kind="src" path="src"/>
 | 
						<classpathentry kind="src" path="src/"/>
 | 
				
			||||||
	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
 | 
					 | 
				
			||||||
	<classpathentry kind="output" path="target/classes"/>
 | 
						<classpathentry kind="output" path="target/classes"/>
 | 
				
			||||||
</classpath>
 | 
					</classpath>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
							
								
								
									
										36
									
								
								com.minres.scviewer.ui/src/com/minres/scviewer/ui/Hex.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								com.minres.scviewer.ui/src/com/minres/scviewer/ui/Hex.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					package com.minres.scviewer.ui;
 | 
				
			||||||
 | 
					public final class Hex {
 | 
				
			||||||
 | 
					    public static byte[] decode(final String hex) {
 | 
				
			||||||
 | 
					        if (hex.length() % 2 != 0) {
 | 
				
			||||||
 | 
					            throw new IllegalArgumentException("A hex string must contain an even number of characters: " + hex);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        byte[] out = new byte[hex.length() / 2];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        for (int i = 0; i < hex.length(); i += 2) {
 | 
				
			||||||
 | 
					            int high = Character.digit(hex.charAt(i), 16);
 | 
				
			||||||
 | 
					            int low = Character.digit(hex.charAt(i + 1), 16);
 | 
				
			||||||
 | 
					            if (high == -1 || low == -1) {
 | 
				
			||||||
 | 
					                throw new IllegalArgumentException("A hex string can only contain the characters 0-9, A-F, a-f: " + hex);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            out[i / 2] = (byte) (high * 16 + low);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return out;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private static final char[] UPPER_HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static String encode(final byte[] bytes) {
 | 
				
			||||||
 | 
					        StringBuilder stringBuilder = new StringBuilder(bytes.length * 2);
 | 
				
			||||||
 | 
					        for (byte cur : bytes) {
 | 
				
			||||||
 | 
					            stringBuilder.append(UPPER_HEX_DIGITS[(cur >> 4) & 0xF]);
 | 
				
			||||||
 | 
					            stringBuilder.append(UPPER_HEX_DIGITS[(cur & 0xF)]);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return stringBuilder.toString();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private Hex() {
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -71,7 +71,7 @@ public class TxEditorInputFactory implements IElementFactory {
 | 
				
			|||||||
            String listData = memento.getString(TAG_STREAMLIST);
 | 
					            String listData = memento.getString(TAG_STREAMLIST);
 | 
				
			||||||
            if (listData != null) {
 | 
					            if (listData != null) {
 | 
				
			||||||
				try {
 | 
									try {
 | 
				
			||||||
	    	        ByteArrayInputStream bais = new ByteArrayInputStream(javax.xml.bind.DatatypeConverter.parseHexBinary(listData));
 | 
						    	        ByteArrayInputStream bais = new ByteArrayInputStream(Hex.decode(listData));
 | 
				
			||||||
	    	        ObjectInputStream ois = new ObjectInputStream(bais);
 | 
						    	        ObjectInputStream ois = new ObjectInputStream(bais);
 | 
				
			||||||
	    	        Object obj = ois.readObject();
 | 
						    	        Object obj = ois.readObject();
 | 
				
			||||||
	    	        if(obj instanceof List<?>)
 | 
						    	        if(obj instanceof List<?>)
 | 
				
			||||||
@@ -107,8 +107,9 @@ public class TxEditorInputFactory implements IElementFactory {
 | 
				
			|||||||
	        ByteArrayOutputStream baos = new ByteArrayOutputStream();
 | 
						        ByteArrayOutputStream baos = new ByteArrayOutputStream();
 | 
				
			||||||
			ObjectOutputStream oos = new ObjectOutputStream(baos);
 | 
								ObjectOutputStream oos = new ObjectOutputStream(baos);
 | 
				
			||||||
	        oos.writeObject(input.getStreamNames());
 | 
						        oos.writeObject(input.getStreamNames());
 | 
				
			||||||
	        memento.putString(TAG_STREAMLIST, javax.xml.bind.DatatypeConverter.printHexBinary(baos.toByteArray()));
 | 
						        memento.putString(TAG_STREAMLIST, Hex.encode(baos.toByteArray()));
 | 
				
			||||||
		} catch (IOException e) {
 | 
							} catch (IOException e) {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +0,0 @@
 | 
				
			|||||||
eclipse.preferences.version=1
 | 
					 | 
				
			||||||
encoding/<project>=UTF-8
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user