mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-06-01 18:41:27 +00:00
fix selection highlight not being marked
This commit is contained in:
parent
a2d4c4c05c
commit
b1c9e1aadc
|
@ -25,8 +25,9 @@ class CatalogEntry extends AbstractCatalogEntry
|
|||
dosDisk.sectorTypes[da.getBlock ()] = dosDisk.tsListSector;
|
||||
else
|
||||
{
|
||||
System.out.print ("Attempt to assign TS sector to occupied sector : " + da);
|
||||
System.out.println (" from " + name);
|
||||
System.out.printf ("Attempt to assign TS sector to occupied sector "
|
||||
+ ": %s from %s%n", da, name);
|
||||
break;
|
||||
}
|
||||
tsSectors.add (da);
|
||||
byte[] sectorBuffer = disk.readSector (da);
|
||||
|
|
|
@ -101,7 +101,6 @@ class DiskLayoutImage extends JPanel implements Scrollable, RedoListener
|
|||
|
||||
int maxBlock = gw * gh;
|
||||
Disk d = disk.getDisk ();
|
||||
List<DiskAddress> selectedBlocks = selectionHandler.getHighlights ();
|
||||
|
||||
// this stops an index error when using alt-5 to switch to 512-byte blocks
|
||||
// if (maxBlock > d.getTotalBlocks ())
|
||||
|
@ -116,8 +115,8 @@ class DiskLayoutImage extends JPanel implements Scrollable, RedoListener
|
|||
{
|
||||
DiskAddress da = d.getDiskAddress (blockNo);
|
||||
boolean flag = showFreeSectors && disk.isSectorFree (da);
|
||||
boolean selected = selectedBlocks.contains (da);
|
||||
drawBlock ((Graphics2D) g, blockNo, x, y, flag, selected);
|
||||
drawBlock ((Graphics2D) g, blockNo, x, y, flag,
|
||||
selectionHandler.isSelected (da));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,6 +126,14 @@ class DiskLayoutSelection implements Iterable<DiskAddress>
|
|||
return new ArrayList<DiskAddress> (highlights);
|
||||
}
|
||||
|
||||
public boolean isSelected (DiskAddress da)
|
||||
{
|
||||
for (DiskAddress selection : highlights)
|
||||
if (selection.compareTo (da) == 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSelection (List<DiskAddress> list)
|
||||
{
|
||||
highlights.clear ();
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.bytezone.diskbrowser.visicalc;
|
|||
|
||||
class Or extends Function
|
||||
{
|
||||
|
||||
public Or (Sheet parent, String text)
|
||||
{
|
||||
super (parent, text);
|
||||
|
|
Loading…
Reference in New Issue
Block a user