Commit b3ae2c9e authored by petter's avatar petter

Corrected off-by-one problem in Editor; Removed old TTT-Editor

git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@163 0463f305-d864-43cb-8a47-61cf597d4139
parent 38227060
......@@ -105,7 +105,7 @@ import ttt.record.LectureProfileDialog;
import ttt.record.Recording;
public class TTT extends JFrame {
static final String version = "09.04.2014";
static final String version = "11.04.2014";
public static boolean debug = !true;
public static boolean verbose = true;
......@@ -739,28 +739,7 @@ public class TTT extends JFrame {
menuBar.add(menu2);
menuItem = new JMenuItem("Open Editor");
// Open Editor
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if (enabledNativeLookAndFeel) {
try {
UIManager.setLookAndFeel(UIManager
.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
TTTEditor.OpenEditorAndShowFileDialog();
}
});
menuItem.setToolTipText("run TTT Editor to edit recorded lectures");
menuItem.setIcon(Constants.getIcon("16x16/configure.png"));
menuItem.setMnemonic(KeyEvent.VK_F);
menu2.add(menuItem);
menuItem = new JMenuItem("Open Editor2 Beta");
// Open Editor
// Open Editor2
menuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
......
......@@ -584,7 +584,7 @@ public class TTTProcessor {
duration + placeholderRecording[i].getMessages().getMessages().get(j).getTimestamp());
}
}
finalExtensions.addAll(placeholderRecording[i].getExtensions());
//finalExtensions.addAll(placeholderRecording[i].getExtensions());
finalMessages.addAll(placeholderRecording[i].getMessages().getMessages());
duration += (placeholderRecording[i].getMessages().get(placeholderRecording[i].getMessages().size()-1).getTimestamp());
......@@ -595,7 +595,7 @@ public class TTTProcessor {
}
FinalRecord = placeholderRecording[0];
FinalRecord.resetIndex();
FinalRecord.setMessages(finalMessages);
FinalRecord.setfileDesktop(outputFile);
FinalRecord.setExtensions(finalExtensions);
......
......@@ -436,6 +436,7 @@ public class Recording extends MessageProducerAdapter implements Runnable,
int len;
while ((len = in.readInt()) > 0) {
byte[] extension = new byte[len];
System.out.println("About to read #bytes: "+len);
in.readFully(extension);
if (TTT.verbose)
System.out.println("Extension: Tag[" + extension[0] + "] "
......@@ -451,6 +452,7 @@ public class Recording extends MessageProducerAdapter implements Runnable,
original = false;
}
public void resetIndex() { index =null; }
public Index index = new Index(this);
private void parseExtensions() throws IOException {
......@@ -958,7 +960,7 @@ public class Recording extends MessageProducerAdapter implements Runnable,
out.writeByte(0); // padding
out.writeByte(0);
out.writeByte(0);
out.writeInt(prefs.name.length());
out.writeInt(prefs.name.length()+1);//getBytes() is Null-terminated!!!!
out.write(prefs.name.getBytes());
}
......@@ -969,9 +971,9 @@ public class Recording extends MessageProducerAdapter implements Runnable,
void writeExtensions(DataOutputStream out) throws IOException {
// write current index extensions instead of read one (maybe modified)
System.out.println("Writing Index Table");
index.writeIndexExtension(out);
if (index!=null) index.writeIndexExtension(out);
if (index.getSearchbaseFormat() == Index.XML_SEARCHBASE) {
if (index!=null) if (index.getSearchbaseFormat() == Index.XML_SEARCHBASE) {
System.out.println("Write Searchbase");
SearchbaseExtension.writeSearchbaseExtension(out, index);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment