mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-03-16 06:31:36 +00:00
changed da.compareTo (da) == 0 to da.matches(da)
This commit is contained in:
parent
a5f57d54e3
commit
edaa7954c7
@ -107,7 +107,7 @@ public class DirectoryEntry implements AppleFileSource
|
||||
public boolean contains (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress sector : blocks)
|
||||
if (sector.compareTo (da) == 0)
|
||||
if (sector.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class DefaultAppleFileSource implements AppleFileSource
|
||||
public boolean contains (DiskAddress diskAddress)
|
||||
{
|
||||
for (DiskAddress da : blocks)
|
||||
if (da.compareTo (diskAddress) == 0)
|
||||
if (da.matches (diskAddress))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public interface FormattedDisk
|
||||
public List<DiskAddress> getFileSectors (int fileNo);
|
||||
|
||||
// Methods implemented by AbstractFormattedDisk
|
||||
public JTree getCatalogTree (); // each node is an AppleFileSource
|
||||
public JTree getCatalogTree (); // each node is an AppleFileSource
|
||||
|
||||
public List<AppleFileSource> getCatalogList ();
|
||||
|
||||
|
@ -40,9 +40,10 @@ public class SectorList extends AbstractFile
|
||||
String owner = formattedDisk.getSectorFilename (da);
|
||||
if (owner == null)
|
||||
owner = "";
|
||||
text.append (String.format (" %04X %-18s %s%n", da.getBlock (), sectorType.name, owner));
|
||||
text.append (String.format (" %04X %-18s %s%n", da.getBlock (), sectorType.name,
|
||||
owner));
|
||||
}
|
||||
|
||||
return text.toString ();
|
||||
}
|
||||
}
|
||||
}
|
@ -260,11 +260,11 @@ abstract class AbstractCatalogEntry implements AppleFileSource
|
||||
public boolean contains (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress sector : tsSectors)
|
||||
if (sector.compareTo (da) == 0)
|
||||
if (sector.matches (da))
|
||||
return true;
|
||||
for (DiskAddress sector : dataSectors)
|
||||
// random access files may have gaps, and thus null sectors
|
||||
if (sector != null && sector.compareTo (da) == 0)
|
||||
if (sector != null && sector.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ class CatalogEntry extends AbstractCatalogEntry
|
||||
break;
|
||||
}
|
||||
|
||||
if (thisDA.compareTo (da) == 0)
|
||||
if (thisDA.matches (da))
|
||||
{
|
||||
System.out.printf ("Next T/S list in sector %s points to itself%n", thisDA);
|
||||
break;
|
||||
|
@ -15,7 +15,7 @@ import com.bytezone.common.State;
|
||||
public class DiskBrowser extends JFrame implements DiskSelectionListener, QuitListener
|
||||
{
|
||||
private static final String windowTitle = "Apple ][ Disk Browser";
|
||||
private static final String PREFS_FULL_SCREEN = "full screen";
|
||||
// private static final String PREFS_FULL_SCREEN = "full screen";
|
||||
private final Preferences prefs = Preferences.userNodeForPackage (this.getClass ());
|
||||
private WindowSaver windowSaver;
|
||||
|
||||
@ -36,7 +36,8 @@ public class DiskBrowser extends JFrame implements DiskSelectionListener, QuitLi
|
||||
setLayout (new BorderLayout ());
|
||||
add (toolBar, BorderLayout.NORTH);
|
||||
|
||||
RedoHandler redoHandler = new RedoHandler (getRootPane (), toolBar); // add nav buttons
|
||||
// add navigation buttons
|
||||
RedoHandler redoHandler = new RedoHandler (getRootPane (), toolBar);
|
||||
toolBar.addSeparator ();
|
||||
|
||||
// create and add the left-hand catalog panel
|
||||
|
@ -36,6 +36,7 @@ class DiskDetails
|
||||
@Override
|
||||
public String toString ()
|
||||
{
|
||||
return String.format ("%s (%s)", file.getAbsolutePath (), duplicate ? "duplicate" : "OK");
|
||||
return String.format ("%s (%s)", file.getAbsolutePath (),
|
||||
duplicate ? "duplicate" : "OK");
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ class DiskLayoutSelection implements Iterable<DiskAddress>
|
||||
* If the click was on an existing highlight, just remove it (regardless of modifiers)
|
||||
*/
|
||||
for (DiskAddress setDA : highlights)
|
||||
if (da.compareTo (setDA) == 0)
|
||||
if (da.matches (setDA))
|
||||
{
|
||||
highlights.remove (setDA);
|
||||
return;
|
||||
|
@ -20,7 +20,7 @@ public class InfocomDisk extends AbstractFormattedDisk
|
||||
private static final boolean TYPE_NODE = true;
|
||||
private static final boolean TYPE_LEAF = false;
|
||||
private byte[] data;
|
||||
private int version;
|
||||
// private int version;
|
||||
private final Header header;
|
||||
|
||||
Color green = new Color (0, 200, 0);
|
||||
|
@ -41,7 +41,7 @@ abstract class CatalogEntry implements AppleFileSource
|
||||
public boolean contains (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress sector : blocks)
|
||||
if (sector.compareTo (da) == 0)
|
||||
if (sector.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class PascalCodeObject implements AppleFileSource
|
||||
public boolean contains (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress sector : blocks)
|
||||
if (sector.compareTo (da) == 0)
|
||||
if (sector.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ abstract class CatalogEntry implements AppleFileSource
|
||||
public boolean contains (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress sector : dataBlocks)
|
||||
if (sector.compareTo (da) == 0)
|
||||
if (sector.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -542,10 +542,10 @@ class FileEntry extends CatalogEntry implements ProdosConstants
|
||||
if (da.equals (masterIndexBlock))
|
||||
return true;
|
||||
for (DiskAddress block : indexBlocks)
|
||||
if (block.compareTo (da) == 0)
|
||||
if (block.matches (da))
|
||||
return true;
|
||||
for (DiskAddress block : dataBlocks)
|
||||
if (block.compareTo (da) == 0)
|
||||
if (block.matches (da))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user