Worked out externalizable strings for PascalFileEntry and PascalFormatDisk.

This commit is contained in:
Robert Greene 2006-04-22 04:13:33 +00:00
parent 379d4df5b9
commit eb7b228075
3 changed files with 19 additions and 15 deletions

View File

@ -123,11 +123,15 @@ PascalFormatDisk.MostRecentDateSetting=Most Recent Date Setting
PascalFormatDisk.BytesInLastBlock=Bytes in last block
PascalFormatDisk.FirstBlock=First Block
PascalFormatDisk.LastBlock=Last Block
PascalFormatDisk.VolumeDate=Volume Date
PascalFormatDisk.IncorrectFileEntryError=Must have a Pascal file entry\!
PascalFormatDisk.DiskFull=Disk full.
# PascalFileEntry
PascalFileEntry.UnknownFiletype=unknown ({0})
PascalFileEntry.PascalDateFormat=dd-MMM-yy
PascalFileEntry.LineLengthError=Lines must be < 1024 characters.
PascalFileEntry.NotEnoughRoom=Not enough room.
# DosFormatDisk
DosFormatDisk.InvalidDimensionError=Invalid dimension for isFree\! Did you call next first?

View File

@ -130,19 +130,19 @@ public class PascalFileEntry implements FileEntry {
* @author John B. Matthews
*/
public void setFiletype(String filetype) {
if ("bad".equalsIgnoreCase(filetype)) {
if ("bad".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 1);
} else if ("code".equalsIgnoreCase(filetype)) {
} else if ("code".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 2);
} else if ("text".equalsIgnoreCase(filetype)) {
} else if ("text".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 3);
} else if ("info".equalsIgnoreCase(filetype)) {
} else if ("info".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 4);
} else if ("data".equalsIgnoreCase(filetype)) {
} else if ("data".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 5);
} else if ("graf".equalsIgnoreCase(filetype)) {
} else if ("graf".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 6);
} else if ("foto".equalsIgnoreCase(filetype)) {
} else if ("foto".equalsIgnoreCase(filetype)) { //$NON-NLS-1$
AppleUtil.setWordValue(fileEntry, 4, 7);
} else {
AppleUtil.setWordValue(fileEntry, 4, 0);
@ -367,7 +367,7 @@ public class PascalFileEntry implements FileEntry {
}
i--;
}
storageError("Lines must be < 1024 characters.");
storageError(textBundle.get("PascalFileEntry.LineLengthError")); //$NON-NLS-1$
return 0;
}
@ -389,7 +389,7 @@ public class PascalFileEntry implements FileEntry {
disk.writeBlock(first, buf); pages++;
while (offset + 1023 < data.length) {
if ((pages * 2) > (last - first - 2)) {
storageError("Not enough room.");
storageError(textBundle.get("PascalFileEntry.NotEnoughRoom")); //$NON-NLS-1$
}
int crPtr = findEOL(data, offset);
System.arraycopy(data, offset, buf, 0, crPtr - offset + 1);
@ -405,7 +405,7 @@ public class PascalFileEntry implements FileEntry {
setBytesUsedInLastBlock(512);
} else { // data or code
if (data.length > (last - first) * 512) {
storageError("Not enough room.");
storageError(textBundle.get("PascalFileEntry.NotEnoughRoom")); //$NON-NLS-1$
}
byte[] buf = new byte[512];
int blocks = data.length / 512;

View File

@ -230,8 +230,8 @@ public class PascalFormatDisk extends FormattedDisk {
first = ((PascalFileEntry) dir.get(index - 1)).getLastBlock();
entry.setFirstBlock(first);
entry.setLastBlock(first + max);
entry.setFiletype("data");
entry.setFilename("x");
entry.setFiletype("data"); //$NON-NLS-1$
entry.setFilename("x"); //$NON-NLS-1$
entry.setBytesUsedInLastBlock(512);
entry.setModificationDate(new Date());
entry.setEntryIndex(index);
@ -240,7 +240,7 @@ public class PascalFormatDisk extends FormattedDisk {
putDirectory(dir);
return entry;
} else {
throw new DiskFullException("Disk full.");
throw new DiskFullException(textBundle.get("PascalFormatDisk.DiskFull")); //$NON-NLS-1$
}
}
@ -450,8 +450,8 @@ public class PascalFormatDisk extends FormattedDisk {
textBundle.get("PascalFormatDisk.LastAccessDate"), getLastAccessDate())); //$NON-NLS-1$
list.add(new DiskInformation(
textBundle.get("PascalFormatDisk.MostRecentDateSetting"), getMostRecentDateSetting())); //$NON-NLS-1$
list.add(new DiskInformation("First Block", getFirstBlock()));
list.add(new DiskInformation("Volume Date", getLastAccessDate()));
list.add(new DiskInformation(textBundle.get("PascalFormatDisk.FirstBlock"), getFirstBlock())); //$NON-NLS-1$
list.add(new DiskInformation(textBundle.get("PascalFormatDisk.VolumeDate"), getLastAccessDate())); //$NON-NLS-1$
return list;
}