remove ITxGenerator interface
This commit is contained in:
		| @@ -28,7 +28,6 @@ import com.minres.scviewer.database.sqlite.tables.ScvTxEvent; | |||||||
| import com.minres.scviewer.database.sqlite.tables.ScvTxRelation; | import com.minres.scviewer.database.sqlite.tables.ScvTxRelation; | ||||||
| import com.minres.scviewer.database.tx.ITx; | import com.minres.scviewer.database.tx.ITx; | ||||||
| import com.minres.scviewer.database.tx.ITxAttribute; | import com.minres.scviewer.database.tx.ITxAttribute; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
| import com.minres.scviewer.database.tx.ITxRelation; | import com.minres.scviewer.database.tx.ITxRelation; | ||||||
|  |  | ||||||
| public class Tx implements ITx { | public class Tx implements ITx { | ||||||
| @@ -61,7 +60,7 @@ public class Tx implements ITx { | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	@Override | 	@Override | ||||||
| 	public ITxGenerator getGenerator() { | 	public IWaveform getGenerator() { | ||||||
| 		return trGenerator; | 		return trGenerator; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,9 +22,8 @@ import com.minres.scviewer.database.sqlite.db.SQLiteDatabaseSelectHandler; | |||||||
| import com.minres.scviewer.database.sqlite.tables.ScvGenerator; | import com.minres.scviewer.database.sqlite.tables.ScvGenerator; | ||||||
| import com.minres.scviewer.database.sqlite.tables.ScvTx; | import com.minres.scviewer.database.sqlite.tables.ScvTx; | ||||||
| import com.minres.scviewer.database.tx.ITx; | import com.minres.scviewer.database.tx.ITx; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
|  |  | ||||||
| public class TxGenerator extends AbstractTxStream implements ITxGenerator { | public class TxGenerator extends AbstractTxStream { | ||||||
|  |  | ||||||
| 	private TxStream  stream; | 	private TxStream  stream; | ||||||
| 	 | 	 | ||||||
| @@ -44,11 +43,6 @@ public class TxGenerator extends AbstractTxStream implements ITxGenerator { | |||||||
| 		return (long) scvGenerator.getId(); | 		return (long) scvGenerator.getId(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	@Override |  | ||||||
| 	public IWaveform getStream() { |  | ||||||
| 		return stream; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	@Override | 	@Override | ||||||
| 	public String getName() { | 	public String getName() { | ||||||
| 		return scvGenerator.getName(); | 		return scvGenerator.getName(); | ||||||
|   | |||||||
| @@ -26,7 +26,6 @@ import com.minres.scviewer.database.sqlite.tables.ScvGenerator; | |||||||
| import com.minres.scviewer.database.sqlite.tables.ScvStream; | import com.minres.scviewer.database.sqlite.tables.ScvStream; | ||||||
| import com.minres.scviewer.database.sqlite.tables.ScvTx; | import com.minres.scviewer.database.sqlite.tables.ScvTx; | ||||||
| import com.minres.scviewer.database.tx.ITx; | import com.minres.scviewer.database.tx.ITx; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
|  |  | ||||||
| public class TxStream extends AbstractTxStream { | public class TxStream extends AbstractTxStream { | ||||||
|  |  | ||||||
| @@ -54,7 +53,7 @@ public class TxStream extends AbstractTxStream { | |||||||
| 		return (long) scvStream.getId(); | 		return (long) scvStream.getId(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	public List<ITxGenerator> getGenerators() { | 	public List<IWaveform> getGenerators() { | ||||||
| 		if(generators==null){ | 		if(generators==null){ | ||||||
| 			SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>( | 			SQLiteDatabaseSelectHandler<ScvGenerator> handler = new SQLiteDatabaseSelectHandler<>( | ||||||
| 					ScvGenerator.class, database, "stream="+scvStream.getId()); | 					ScvGenerator.class, database, "stream="+scvStream.getId()); | ||||||
|   | |||||||
| @@ -19,7 +19,6 @@ import java.util.stream.Collectors; | |||||||
| import com.minres.scviewer.database.IWaveform; | import com.minres.scviewer.database.IWaveform; | ||||||
| import com.minres.scviewer.database.tx.ITx; | import com.minres.scviewer.database.tx.ITx; | ||||||
| import com.minres.scviewer.database.tx.ITxAttribute; | import com.minres.scviewer.database.tx.ITxAttribute; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
| import com.minres.scviewer.database.tx.ITxRelation; | import com.minres.scviewer.database.tx.ITxRelation; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -171,7 +170,7 @@ class Tx implements ITx { | |||||||
| 	 * @return the generator | 	 * @return the generator | ||||||
| 	 */ | 	 */ | ||||||
| 	@Override | 	@Override | ||||||
| 	public ITxGenerator getGenerator() { | 	public IWaveform getGenerator() { | ||||||
| 		return loader.txGenerators.get(generatorId); | 		return loader.txGenerators.get(generatorId); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -15,12 +15,11 @@ import java.util.ArrayList; | |||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| import com.minres.scviewer.database.IWaveform; | import com.minres.scviewer.database.IWaveform; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The Class TxGenerator. |  * The Class TxGenerator. | ||||||
|  */ |  */ | ||||||
| class TxGenerator extends AbstractTxStream implements ITxGenerator { | class TxGenerator extends AbstractTxStream { | ||||||
|  |  | ||||||
| 	/** The stream. */ | 	/** The stream. */ | ||||||
| 	TxStream stream; | 	TxStream stream; | ||||||
| @@ -45,16 +44,6 @@ class TxGenerator extends AbstractTxStream implements ITxGenerator { | |||||||
| 		stream.addChild(this); | 		stream.addChild(this); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/** |  | ||||||
| 	 * Gets the stream. |  | ||||||
| 	 * |  | ||||||
| 	 * @return the stream |  | ||||||
| 	 */ |  | ||||||
| 	@Override |  | ||||||
| 	public IWaveform getStream() { |  | ||||||
| 		return stream; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Checks if is same. | 	 * Checks if is same. | ||||||
| 	 * | 	 * | ||||||
|   | |||||||
| @@ -29,7 +29,6 @@ import com.minres.scviewer.database.IWaveform; | |||||||
| import com.minres.scviewer.database.RelationType; | import com.minres.scviewer.database.RelationType; | ||||||
| import com.minres.scviewer.database.tx.ITx; | import com.minres.scviewer.database.tx.ITx; | ||||||
| import com.minres.scviewer.database.tx.ITxEvent; | import com.minres.scviewer.database.tx.ITxEvent; | ||||||
| import com.minres.scviewer.database.tx.ITxGenerator; |  | ||||||
| import com.minres.scviewer.database.tx.ITxRelation; | import com.minres.scviewer.database.tx.ITxRelation; | ||||||
| import com.minres.scviewer.database.ui.WaveformColors; | import com.minres.scviewer.database.ui.WaveformColors; | ||||||
|  |  | ||||||
| @@ -118,7 +117,7 @@ public class ArrowPainter implements IPainter { | |||||||
| 				return; | 				return; | ||||||
| 			} else { | 			} else { | ||||||
| 				for(IHierNode gen:otherTx.getStream().getChildNodes()) { | 				for(IHierNode gen:otherTx.getStream().getChildNodes()) { | ||||||
| 					if(gen instanceof ITxGenerator) { | 					if(gen instanceof IWaveform) { | ||||||
| 						bb = createLinkEntry(otherTx, (IWaveform) gen); | 						bb = createLinkEntry(otherTx, (IWaveform) gen); | ||||||
| 						if(bb!=null){ | 						if(bb!=null){ | ||||||
| 							res.add(new LinkEntry(bb, iTxRelation.getRelationType())); | 							res.add(new LinkEntry(bb, iTxRelation.getRelationType())); | ||||||
| @@ -135,7 +134,7 @@ public class ArrowPainter implements IPainter { | |||||||
| 			IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream()); | 			IWaveformPainter painter = waveCanvas.wave2painterMap.get(otherTx.getStream()); | ||||||
| 			if(painter==null) { | 			if(painter==null) { | ||||||
| 				for(IHierNode gen:otherTx.getStream().getChildNodes()) { | 				for(IHierNode gen:otherTx.getStream().getChildNodes()) { | ||||||
| 					if(gen instanceof ITxGenerator) { | 					if(gen instanceof IWaveform) { | ||||||
| 						 painter = waveCanvas.wave2painterMap.get(gen); | 						 painter = waveCanvas.wave2painterMap.get(gen); | ||||||
| 						 if(painter!=null) | 						 if(painter!=null) | ||||||
| 							 break; | 							 break; | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ package com.minres.scviewer.database; | |||||||
|  |  | ||||||
| import java.util.NavigableMap; | import java.util.NavigableMap; | ||||||
|  |  | ||||||
|  | // TODO: Auto-generated Javadoc | ||||||
| /** | /** | ||||||
|  * The Interface IWaveform. |  * The Interface IWaveform. | ||||||
|  * |  * | ||||||
| @@ -78,5 +79,8 @@ public interface IWaveform extends IHierNode { | |||||||
| 	 */ | 	 */ | ||||||
| 	public int getRowCount(); | 	public int getRowCount(); | ||||||
| 	 | 	 | ||||||
|  | 	/** | ||||||
|  | 	 * Calculate the concurrency (th enumber of parallel ongoing events) of the waveform. | ||||||
|  | 	 */ | ||||||
| 	public void calculateConcurrency(); | 	public void calculateConcurrency(); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -39,7 +39,7 @@ public interface ITx extends Comparable<ITx> { | |||||||
| 	 * | 	 * | ||||||
| 	 * @return the generator | 	 * @return the generator | ||||||
| 	 */ | 	 */ | ||||||
| 	public ITxGenerator getGenerator(); | 	public IWaveform getGenerator(); | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Gets the begin time. | 	 * Gets the begin time. | ||||||
|   | |||||||
| @@ -1,27 +0,0 @@ | |||||||
| /******************************************************************************* |  | ||||||
|  * Copyright (c) 2015-2021 MINRES Technologies GmbH and others. |  | ||||||
|  * All rights reserved. This program and the accompanying materials |  | ||||||
|  * are made available under the terms of the Eclipse Public License v1.0 |  | ||||||
|  * which accompanies this distribution, and is available at |  | ||||||
|  * http://www.eclipse.org/legal/epl-v10.html |  | ||||||
|  * |  | ||||||
|  * Contributors: |  | ||||||
|  *     MINRES Technologies GmbH - initial API and implementation |  | ||||||
|  *******************************************************************************/ |  | ||||||
| package com.minres.scviewer.database.tx; |  | ||||||
|  |  | ||||||
| import com.minres.scviewer.database.IWaveform; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * The Interface ITxGenerator. |  | ||||||
|  */ |  | ||||||
| public interface ITxGenerator extends IWaveform { |  | ||||||
|  |  | ||||||
| 	/** |  | ||||||
| 	 * Gets the stream. |  | ||||||
| 	 * |  | ||||||
| 	 * @return the stream |  | ||||||
| 	 */ |  | ||||||
| 	public IWaveform getStream(); |  | ||||||
|  |  | ||||||
| } |  | ||||||
		Reference in New Issue
	
	Block a user