use of se.light.assembly64.d64.db.DiskFile in project assembly64fx by freabemania.
the class DiskImage method getDisk.
/**
* Get <code>Disk</code> instance of current image. This is used when saving to database.
* @return Disk
*/
public Disk getDisk() {
Disk disk = new Disk();
disk.setLabel(getBam().getDiskName());
disk.setImageType(imageFormat);
disk.setErrors(errors);
disk.setWarnings(warnings);
for (int filenumber = 0; filenumber <= getFilenumberMax() - 1; filenumber++) {
boolean isLocked = getCbmFile(filenumber).isFileLocked();
boolean isClosed = getCbmFile(filenumber).isFileClosed();
DiskFile file = new DiskFile();
file.setName(getCbmFile(filenumber).getName());
file.setSize(getCbmFile(filenumber).getSizeInBlocks());
file.setFileType(getCbmFile(filenumber).getFileType());
file.setFileNum(filenumber);
file.setFlags((isLocked ? DiskFile.FLAG_LOCKED : 0) | (isClosed ? 0 : DiskFile.FLAG_NOT_CLOSED));
disk.getFileList().add(file);
}
return disk;
}