From fd5bee6e5ce3da7bd55352642c554f8c1954f1ae Mon Sep 17 00:00:00 2001 From: Denis Molony Date: Fri, 7 Apr 2023 19:50:02 +1000 Subject: [PATCH] tidying --- .../bytezone/diskbrowser/nufx/Binary2.java | 21 +++++------ .../diskbrowser/prodos/CatalogEntry.java | 4 +-- .../diskbrowser/prodos/FileEntry.java | 35 ++++++++++--------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/com/bytezone/diskbrowser/nufx/Binary2.java b/src/com/bytezone/diskbrowser/nufx/Binary2.java index f00030d..cca6224 100644 --- a/src/com/bytezone/diskbrowser/nufx/Binary2.java +++ b/src/com/bytezone/diskbrowser/nufx/Binary2.java @@ -17,7 +17,8 @@ public class Binary2 // -----------------------------------------------------------------------------------// { private static final String UNDERLINE = - "------------------------------------------------------" + "-----------------------"; + "------------------------------------------------------" + + "-----------------------"; private Binary2Header binary2Header; private byte[] buffer; @@ -54,8 +55,8 @@ public class Binary2 } // ---------------------------------------------------------------------------------// - public byte[] getDiskBuffer () - throws DiskFullException, VolumeCatalogFullException, FileAlreadyExistsException, IOException + public byte[] getDiskBuffer () throws DiskFullException, VolumeCatalogFullException, + FileAlreadyExistsException, IOException // ---------------------------------------------------------------------------------// { ProdosDisk disk = new ProdosDisk (800, "DiskBrowser"); @@ -72,8 +73,8 @@ public class Binary2 Squeeze squeeze = new Squeeze (); byte[] tmp = squeeze.unSqueeze (dataBuffer); - disk.addFile (name, header.fileType, header.auxType, header.created, header.modified, tmp, - tmp.length); + disk.addFile (name, header.fileType, header.auxType, header.created, + header.modified, tmp, tmp.length); } else disk.addFile (header.fileName, header.fileType, header.auxType, header.created, @@ -91,12 +92,12 @@ public class Binary2 { StringBuilder text = new StringBuilder (); - text.append ( - String.format (" %-15.15s Files:%5d%n%n", - fileName, headers.size ())); + text.append (String.format ( + " %-15.15s Files:%5d%n%n", + fileName, headers.size ())); - text.append ( - " Name Type Auxtyp Modified" + " Fmat Length\n"); + text.append (" Name Type Auxtyp Modified" + + " Fmat Length\n"); text.append (String.format ("%s%n", UNDERLINE)); diff --git a/src/com/bytezone/diskbrowser/prodos/CatalogEntry.java b/src/com/bytezone/diskbrowser/prodos/CatalogEntry.java index 030908b..5c7e6ff 100755 --- a/src/com/bytezone/diskbrowser/prodos/CatalogEntry.java +++ b/src/com/bytezone/diskbrowser/prodos/CatalogEntry.java @@ -15,8 +15,8 @@ import com.bytezone.diskbrowser.utilities.Utility; abstract class CatalogEntry implements AppleFileSource // -----------------------------------------------------------------------------------// { - static String[] storageTypes = - { "Del", "Sdl", "Sap", "Tre", "Pas", "Ext", "", "", "", "", "", "", "", "DIR", "SDH", "VDH" }; + static String[] storageTypes = { "Del", "Sdl", "Sap", "Tre", "Pas", "Ext", "", "", "", + "", "", "", "", "DIR", "SDH", "VDH" }; Disk disk; ProdosDisk parentDisk; diff --git a/src/com/bytezone/diskbrowser/prodos/FileEntry.java b/src/com/bytezone/diskbrowser/prodos/FileEntry.java index 829ec04..e9c2f28 100755 --- a/src/com/bytezone/diskbrowser/prodos/FileEntry.java +++ b/src/com/bytezone/diskbrowser/prodos/FileEntry.java @@ -72,8 +72,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants private FileEntry link; // ---------------------------------------------------------------------------------// - FileEntry (ProdosDisk fDisk, byte[] entryBuffer, DirectoryHeader parent, int parentBlock, - int entryNo) + FileEntry (ProdosDisk fDisk, byte[] entryBuffer, DirectoryHeader parent, + int parentBlock, int entryNo) // ---------------------------------------------------------------------------------// { super (fDisk, entryBuffer, parentBlock, entryNo); @@ -101,7 +101,6 @@ class FileEntry extends CatalogEntry implements ProdosConstants case GSOS_EXTENDED_FILE: readForks (); - // System.out.printf ("%s has forks%n", getUniqueName ()); break; case SUBDIRECTORY: @@ -351,7 +350,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants file = new DoubleHiResImage (name, outBuffer); break; case 0x8000: - file = new SHRPictureFile2 (name, outBuffer, FILE_TYPE_PIC, 0x2000, 0x8000); + file = + new SHRPictureFile2 (name, outBuffer, FILE_TYPE_PIC, 0x2000, 0x8000); break; default: file = new AssemblerProgram (name, exactBuffer, auxType); @@ -371,8 +371,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants } // else if (name.endsWith (".PIC")) // 0091 X-BASIC../../XBASIC.PIC // file = new SHRPictureFile2 (name, exactBuffer, fileType, auxType, endOfFile); - else if ((name.equals ("DOS.3.3") || name.equals ("DDOS.3.3")) && endOfFile == 0x2800 - && DosMasterFile.isDos33 (parentDisk, exactBuffer)) + else if ((name.equals ("DOS.3.3") || name.equals ("DDOS.3.3")) + && endOfFile == 0x2800 && DosMasterFile.isDos33 (parentDisk, exactBuffer)) { file = new DosMasterFile (name, exactBuffer); } @@ -415,8 +415,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants case FILE_TYPE_DIRECTORY: VolumeDirectoryHeader vdh = parentDisk.getVolumeDirectoryHeader (); - file = new ProdosDirectory (parentDisk, name, buffer, vdh.totalBlocks, vdh.freeBlocks, - vdh.usedBlocks); + file = new ProdosDirectory (parentDisk, name, buffer, vdh.totalBlocks, + vdh.freeBlocks, vdh.usedBlocks); break; case FILE_TYPE_APPLESOFT_BASIC_VARS: @@ -627,7 +627,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants if (addresses.size () > 0) { byte[] tempBuffer = disk.readBlocks (addresses); - buffers.add (new TextBuffer (tempBuffer, auxType, logicalBlock - addresses.size ())); + buffers.add ( + new TextBuffer (tempBuffer, auxType, logicalBlock - addresses.size ())); addresses.clear (); } logicalBlock += 256; @@ -727,8 +728,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants } // ---------------------------------------------------------------------------------// - private int readIndexBlock (int indexBlock, List addresses, List buffers, - int logicalBlock) + private int readIndexBlock (int indexBlock, List addresses, + List buffers, int logicalBlock) // ---------------------------------------------------------------------------------// { byte[] indexBuffer = disk.readBlock (indexBlock); @@ -740,7 +741,8 @@ class FileEntry extends CatalogEntry implements ProdosConstants else if (addresses.size () > 0) { byte[] tempBuffer = disk.readBlocks (addresses); - buffers.add (new TextBuffer (tempBuffer, auxType, logicalBlock - addresses.size ())); + buffers + .add (new TextBuffer (tempBuffer, auxType, logicalBlock - addresses.size ())); addresses.clear (); } logicalBlock++; @@ -811,13 +813,14 @@ class FileEntry extends CatalogEntry implements ProdosConstants String locked = (access == 0x00) ? "*" : " "; if (true) - return String.format ("%s %03d %s", ProdosConstants.fileTypes[fileType], blocksUsed, locked) - + name; + return String.format ("%s %03d %s", ProdosConstants.fileTypes[fileType], + blocksUsed, locked) + name; String timeC = created == null ? "" : created.format (ProdosDisk.df); String timeF = modified == null ? "" : modified.format (ProdosDisk.df); - return String.format ("%s %s%-30s %3d %,10d %15s %15s", ProdosConstants.fileTypes[fileType], - locked, parentDirectory.name + "/" + name, blocksUsed, endOfFile, timeC, timeF); + return String.format ("%s %s%-30s %3d %,10d %15s %15s", + ProdosConstants.fileTypes[fileType], locked, parentDirectory.name + "/" + name, + blocksUsed, endOfFile, timeC, timeF); } } \ No newline at end of file