text file changes

This commit is contained in:
Denis Molony 2020-12-18 14:28:53 +10:00
parent 7c51072a10
commit 26d218621b

View File

@ -8,11 +8,13 @@ import com.bytezone.diskbrowser.utilities.HexFormatter;
public class BasicTextFile extends TextFile public class BasicTextFile extends TextFile
// -----------------------------------------------------------------------------------// // -----------------------------------------------------------------------------------//
{ {
private static String underline = "------------------------------------------"
+ "------------------------------------\n";
private static String fullUnderline = "---------- ------- " + underline;
private int recordLength; // prodos aux private int recordLength; // prodos aux
private List<TextBuffer> buffers; // only used if it is a Prodos text file private List<TextBuffer> buffers; // only used if it is a Prodos text file
private int eof; private int eof;
private boolean prodosFile; private boolean prodosFile;
// test
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//
public BasicTextFile (String name, byte[] buffer) public BasicTextFile (String name, byte[] buffer)
@ -96,13 +98,12 @@ public class BasicTextFile extends TextFile
if (textPreferences.showTextOffsets) if (textPreferences.showTextOffsets)
{ {
text.append (" Offset Record# Text values\n"); text.append (" Offset Record# Text values\n");
text.append ( text.append (fullUnderline);
"---------- ------- -------------------------------------------------------\n");
} }
else else
{ {
text.append ("Text values\n"); text.append ("Text values\n");
text.append ("-------------------------------------------------------\n"); text.append (underline);
} }
return knownLength (text, 0).toString (); return knownLength (text, 0).toString ();
} }
@ -114,13 +115,12 @@ public class BasicTextFile extends TextFile
if (textPreferences.showTextOffsets) if (textPreferences.showTextOffsets)
{ {
text.append (" Offset Record# Text values\n"); text.append (" Offset Record# Text values\n");
text.append ( text.append (fullUnderline);
"---------- ------- -------------------------------------------------------\n");
} }
else else
{ {
text.append ("Text values\n"); text.append ("Text values\n");
text.append ("-------------------------------------------------------\n"); text.append (underline);
} }
for (TextBuffer tb : buffers) for (TextBuffer tb : buffers)
@ -177,19 +177,16 @@ public class BasicTextFile extends TextFile
int ptr = 0; int ptr = 0;
int size = buffer.length; int size = buffer.length;
int lastVal = 0; int lastVal = 0;
// boolean showAllOffsets = true;
if (textPreferences.showTextOffsets) if (textPreferences.showTextOffsets)
{ {
text.append (" Offset Text values\n"); text.append (" Offset Text values\n");
text.append ("---------- -------------------------------------------------------" text.append ("---------- " + underline);
+ "-------------------\n");
} }
else else
{ {
text.append (" Text values\n"); text.append (" Text values\n");
text.append ("-------------------------------------------------------" text.append (underline);
+ "-------------------------------\n");
} }
if (buffer.length == 0) if (buffer.length == 0)
return text.toString (); return text.toString ();