mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-31 11:29:52 +00:00
Added the new image flag and SaveAs method (essentially a rename).
This commit is contained in:
parent
4c10059f75
commit
00cb73dea2
@ -71,6 +71,7 @@ public class Disk {
|
||||
private byte[] diskImage;
|
||||
private String filename;
|
||||
private boolean changed = false;
|
||||
private boolean newImage = false;
|
||||
|
||||
/**
|
||||
* Get the supported file filters supported by the Disk interface.
|
||||
@ -112,6 +113,7 @@ public class Disk {
|
||||
protected Disk(String filename, byte[] diskImage) {
|
||||
this.diskImage = diskImage;
|
||||
this.filename = filename;
|
||||
this.newImage = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,6 +154,15 @@ public class Disk {
|
||||
output.write(getDiskImage());
|
||||
output.close();
|
||||
changed = false;
|
||||
newImage = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a Disk image as a new/different file.
|
||||
*/
|
||||
public void saveAs(String filename) throws IOException {
|
||||
this.filename = filename;
|
||||
save();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -533,4 +544,12 @@ public class Disk {
|
||||
public boolean hasChanged() {
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the disk image is new. This can be used
|
||||
* for Save As processing.
|
||||
*/
|
||||
public boolean isNewImage() {
|
||||
return newImage;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user