mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-11-27 14:49:25 +00:00
List all disks
This commit is contained in:
parent
cfdb5fcd5c
commit
21419474d1
@ -8,7 +8,7 @@ import javax.swing.table.AbstractTableModel;
|
||||
|
||||
public class DiskTableModel extends AbstractTableModel
|
||||
{
|
||||
static final String[] headers = { "Disk name", "Actual disk", "Checksum" };
|
||||
static final String[] headers = { "Name", "Location", "Checksum" };
|
||||
|
||||
Map<String, DiskDetails> fileNameMap;
|
||||
Map<Long, DiskDetails> checkSumMap;
|
||||
@ -23,31 +23,17 @@ public class DiskTableModel extends AbstractTableModel
|
||||
{
|
||||
DiskDetails original = fileNameMap.get (key);
|
||||
|
||||
if (false)
|
||||
{
|
||||
if (original.getDuplicateNames ().size () > 0)
|
||||
{
|
||||
lines.add (new TableLine (original));
|
||||
for (DiskDetails duplicate : original.getDuplicateNames ())
|
||||
lines.add (new TableLine (duplicate));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (original.getDuplicateChecksums ().size () > 0)
|
||||
{
|
||||
lines.add (new TableLine (original));
|
||||
for (DiskDetails duplicate : original.getDuplicateChecksums ())
|
||||
lines.add (new TableLine (duplicate));
|
||||
}
|
||||
// else if (original.isDuplicateChecksum ())
|
||||
// {
|
||||
// lines.add (new TableLine (key, original));
|
||||
// DiskDetails dd = checkSumMap.get (original.getChecksum ());
|
||||
// for (DiskDetails duplicate : dd.getDuplicateChecksums ())
|
||||
// lines.add (new TableLine (key, duplicate));
|
||||
// }
|
||||
}
|
||||
// if (false)
|
||||
// {
|
||||
// if (original.getDuplicateChecksums ().size () > 0)
|
||||
// {
|
||||
// lines.add (new TableLine (original));
|
||||
// for (DiskDetails duplicate : original.getDuplicateChecksums ())
|
||||
// lines.add (new TableLine (duplicate));
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
lines.add (new TableLine (original));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.JTableHeader;
|
||||
|
||||
public class DuplicateWindow extends JFrame
|
||||
{
|
||||
@ -138,7 +139,7 @@ public class DuplicateWindow extends JFrame
|
||||
}
|
||||
});
|
||||
|
||||
setSize (900, 700);
|
||||
setSize (1100, 700);
|
||||
setLocationRelativeTo (null);
|
||||
setDefaultCloseOperation (HIDE_ON_CLOSE);
|
||||
}
|
||||
@ -147,9 +148,13 @@ public class DuplicateWindow extends JFrame
|
||||
{
|
||||
this.duplicateHandler = duplicateHandler;
|
||||
table.setModel (new DiskTableModel (duplicateHandler));
|
||||
table.getColumnModel ().getColumn (0).setPreferredWidth (250);
|
||||
table.getColumnModel ().getColumn (0).setPreferredWidth (300);
|
||||
table.getColumnModel ().getColumn (1).setPreferredWidth (500);
|
||||
table.getColumnModel ().getColumn (2).setPreferredWidth (100);
|
||||
|
||||
JTableHeader header = table.getTableHeader ();
|
||||
header.setFont (header.getFont ().deriveFont ((float) 13.0));
|
||||
|
||||
setVisible (true);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user