Changed disk creation to use a create method, as this is better

suited to disks that support mutiple logical disks. As part of this change,
the setDiskName method was added to set the ProDOS VOLUME name.
This commit is contained in:
Robert Greene 2002-12-17 05:26:54 +00:00
parent 10d7b000d1
commit 49938c5325
1 changed files with 13 additions and 4 deletions

View File

@ -76,11 +76,13 @@ public class ProdosFormatDisk extends FormattedDisk {
}
/**
* Constructor for ProdosFormatDisk.
* Create a ProdosFormatDisk.
*/
public ProdosFormatDisk(String filename, String diskName, int imageSize) {
this(filename, new byte[imageSize]);
volumeHeader.setVolumeName(diskName);
public static ProdosFormatDisk[] create(String filename, String diskName, int imageSize) {
ProdosFormatDisk disk = new ProdosFormatDisk(filename, new byte[imageSize]);
disk.setDiskName(diskName);
disk.format();
return new ProdosFormatDisk[] { disk };
}
/**
@ -185,6 +187,13 @@ public class ProdosFormatDisk extends FormattedDisk {
public String getDiskName() {
return "/" + volumeHeader.getVolumeName() + "/";
}
/**
* Set the name of the disk (volume name).
*/
public void setDiskName(String volumeName) {
volumeHeader.setVolumeName(volumeName);
}
/**
* Get suggested dimensions for display of bitmap. There is no suggestion