Finished version 1.0

- added relation navigation
- improved about dialog
This commit is contained in:
2015-11-15 22:15:37 +01:00
parent c4fc4e20a6
commit 89fb6629d0
47 changed files with 1201 additions and 590 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/"/>
<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.7"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -22,6 +22,8 @@ public interface IWaveformDb extends IHierNode {
public List<IWaveform<?>> getAllWaves();
public List<RelationType> getAllRelationTypes();
public boolean load(File inp) throws Exception;
public boolean isLoaded();

View File

@ -11,6 +11,7 @@
package com.minres.scviewer.database;
import java.io.File;
import java.util.Collection;
import java.util.List;
public interface IWaveformDbLoader {
@ -21,4 +22,6 @@ public interface IWaveformDbLoader {
public List<IWaveform<? extends IWaveformEvent>> getAllWaves() ;
public Collection<RelationType> getAllRelationTypes() ;
}

View File

@ -10,11 +10,26 @@
*******************************************************************************/
package com.minres.scviewer.database;
import java.util.HashMap;
public class RelationType {
private static HashMap<String, RelationType> registry = new HashMap<>();
private String name;
public RelationType(String name) {
public static RelationType create(String name){
if(registry.containsKey(name)){
return registry.get(name);
}else{
RelationType relType = new RelationType(name);
registry.put(name, relType);
return relType;
}
}
private RelationType(String name) {
super();
this.name = name;
}
@ -30,4 +45,9 @@ public class RelationType {
public String toString(){
return name;
}
@Override
public int hashCode() {
return name.hashCode();
}
}

View File

@ -29,6 +29,7 @@ import com.minres.scviewer.database.IWaveformDb;
import com.minres.scviewer.database.IWaveformDbLoader;
import com.minres.scviewer.database.IWaveformEvent;
import com.minres.scviewer.database.InputFormatException;
import com.minres.scviewer.database.RelationType;
public class WaveformDb extends HierNode implements IWaveformDb {
@ -38,6 +39,8 @@ public class WaveformDb extends HierNode implements IWaveformDb {
private List<IHierNode> childNodes;
private List<RelationType> relationTypes;
private Map<String, IWaveform<?>> waveforms;
private Long maxTime;
@ -59,6 +62,7 @@ public class WaveformDb extends HierNode implements IWaveformDb {
public WaveformDb() {
super();
waveforms = new HashMap<String, IWaveform<?>>();
relationTypes=new ArrayList<>();
maxTime=0L;
}
@ -89,6 +93,7 @@ public class WaveformDb extends HierNode implements IWaveformDb {
}
if(name==null) name=getFileBasename(inp.getName());
buildHierarchyNodes() ;
relationTypes.addAll(loader.getAllRelationTypes());
pcs.firePropertyChange("WAVEFORMS", null, waveforms);
pcs.firePropertyChange("CHILDS", null, childNodes);
loaded = true;
@ -185,4 +190,9 @@ public class WaveformDb extends HierNode implements IWaveformDb {
}
return sb.toString();
}
@Override
public List<RelationType> getAllRelationTypes() {
return relationTypes;
}
}