mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-01 09:50:32 +00:00
tidying
This commit is contained in:
parent
47a07f5cfe
commit
59b22be2bd
@ -23,7 +23,6 @@ public class SHRPictureFile1 extends HiResImage
|
|||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
super (name, buffer, fileType, auxType, eof);
|
super (name, buffer, fileType, auxType, eof);
|
||||||
System.out.println ("here");
|
|
||||||
|
|
||||||
int ptr = 0;
|
int ptr = 0;
|
||||||
while (ptr < buffer.length)
|
while (ptr < buffer.length)
|
||||||
@ -142,7 +141,7 @@ public class SHRPictureFile1 extends HiResImage
|
|||||||
int lo = dirEntry.mode & 0x00FF; // mode bit if hi == 0
|
int lo = dirEntry.mode & 0x00FF; // mode bit if hi == 0
|
||||||
|
|
||||||
boolean fillMode = (dirEntry.mode & 0x20) != 0;
|
boolean fillMode = (dirEntry.mode & 0x20) != 0;
|
||||||
// assert fillMode == false;
|
// assert fillMode == false;
|
||||||
|
|
||||||
if (hi != 0)
|
if (hi != 0)
|
||||||
System.out.println ("hi not zero");
|
System.out.println ("hi not zero");
|
||||||
@ -243,7 +242,8 @@ public class SHRPictureFile1 extends HiResImage
|
|||||||
if (ptr < data.length - 32)
|
if (ptr < data.length - 32)
|
||||||
colorTables[i] = new ColorTable (i, data, ptr);
|
colorTables[i] = new ColorTable (i, data, ptr);
|
||||||
else
|
else
|
||||||
colorTables[i] = new ColorTable (i, 0x00); // default empty table !! not finished
|
colorTables[i] = new ColorTable (i, 0x00); // default empty table !! not
|
||||||
|
// finished
|
||||||
ptr += 32;
|
ptr += 32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,11 +333,11 @@ public class SHRPictureFile1 extends HiResImage
|
|||||||
ptr = 0;
|
ptr = 0;
|
||||||
for (int line = 0; line < numScanLines; line++)
|
for (int line = 0; line < numScanLines; line++)
|
||||||
{
|
{
|
||||||
// if (isOddAndEmpty (packedScanLines[line]))
|
// if (isOddAndEmpty (packedScanLines[line]))
|
||||||
// {
|
// {
|
||||||
// System.out.println ("Odd number of bytes in empty buffer in " + name);
|
// System.out.println ("Odd number of bytes in empty buffer in " + name);
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
int bytesUnpacked = unpack (packedScanLines[line], 0,
|
int bytesUnpacked = unpack (packedScanLines[line], 0,
|
||||||
packedScanLines[line].length, unpackedBuffer, ptr);
|
packedScanLines[line].length, unpackedBuffer, ptr);
|
||||||
@ -353,16 +353,17 @@ public class SHRPictureFile1 extends HiResImage
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------//
|
// -------------------------------------------------------------------------------//
|
||||||
// private boolean isOddAndEmpty (byte[] buffer)
|
// private boolean isOddAndEmpty (byte[] buffer)
|
||||||
// // -------------------------------------------------------------------------------//
|
// //
|
||||||
// {
|
// -------------------------------------------------------------------------------//
|
||||||
// if (buffer.length % 2 == 0)
|
// {
|
||||||
// return false;
|
// if (buffer.length % 2 == 0)
|
||||||
// for (byte b : buffer)
|
// return false;
|
||||||
// if (b != 0)
|
// for (byte b : buffer)
|
||||||
// return false;
|
// if (b != 0)
|
||||||
// return true;
|
// return false;
|
||||||
// }
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------//
|
// -------------------------------------------------------------------------------//
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,7 +52,7 @@ public class DiskBrowser extends JFrame
|
|||||||
{
|
{
|
||||||
super (windowTitle);
|
super (windowTitle);
|
||||||
|
|
||||||
UIManager.put ("TabbedPane.foreground", Color.BLACK); // java bug fix
|
// UIManager.put ("TabbedPane.foreground", Color.BLACK); // java bug fix
|
||||||
|
|
||||||
if (args.length > 0 && "-reset".equals (args[0]))
|
if (args.length > 0 && "-reset".equals (args[0]))
|
||||||
new WindowState (prefs).clear ();
|
new WindowState (prefs).clear ();
|
||||||
@ -85,14 +85,14 @@ public class DiskBrowser extends JFrame
|
|||||||
RootDirectoryAction rootDirectoryAction = new RootDirectoryAction ();
|
RootDirectoryAction rootDirectoryAction = new RootDirectoryAction ();
|
||||||
|
|
||||||
RefreshTreeAction refreshTreeAction = new RefreshTreeAction (catalogPanel);
|
RefreshTreeAction refreshTreeAction = new RefreshTreeAction (catalogPanel);
|
||||||
// PreferencesAction preferencesAction = new PreferencesAction (this, prefs);
|
// PreferencesAction preferencesAction = new PreferencesAction (this, prefs);
|
||||||
AbstractAction print = new PrintAction (dataPanel);
|
AbstractAction print = new PrintAction (dataPanel);
|
||||||
// AboutAction aboutAction = new AboutAction ();
|
// AboutAction aboutAction = new AboutAction ();
|
||||||
// HideLayoutAction hideLayoutAction = new HideLayoutAction (this, layoutBorderPanel);
|
// HideLayoutAction hideLayoutAction = new HideLayoutAction (this, layoutBorderPanel);
|
||||||
ShowFreeSectorsAction showFreeAction = new ShowFreeSectorsAction ();
|
ShowFreeSectorsAction showFreeAction = new ShowFreeSectorsAction ();
|
||||||
|
|
||||||
CloseTabAction closeTabAction = new CloseTabAction (catalogPanel);
|
CloseTabAction closeTabAction = new CloseTabAction (catalogPanel);
|
||||||
// closeTabAction.addPropertyChangeListener (catalogPanel);
|
// closeTabAction.addPropertyChangeListener (catalogPanel);
|
||||||
|
|
||||||
hideCatalogAction.addPropertyChangeListener (this);
|
hideCatalogAction.addPropertyChangeListener (this);
|
||||||
hideLayoutAction.addPropertyChangeListener (this);
|
hideLayoutAction.addPropertyChangeListener (this);
|
||||||
@ -100,10 +100,10 @@ public class DiskBrowser extends JFrame
|
|||||||
// add action buttons to toolbar
|
// add action buttons to toolbar
|
||||||
toolBar.add (rootDirectoryAction);
|
toolBar.add (rootDirectoryAction);
|
||||||
toolBar.add (refreshTreeAction);
|
toolBar.add (refreshTreeAction);
|
||||||
// toolBar.add (preferencesAction);
|
// toolBar.add (preferencesAction);
|
||||||
toolBar.add (duplicateAction);
|
toolBar.add (duplicateAction);
|
||||||
toolBar.add (print);
|
toolBar.add (print);
|
||||||
// toolBar.add (aboutAction);
|
// toolBar.add (aboutAction);
|
||||||
|
|
||||||
// set the listeners
|
// set the listeners
|
||||||
rootDirectoryAction.addPropertyChangeListener (rootFolderData);
|
rootDirectoryAction.addPropertyChangeListener (rootFolderData);
|
||||||
@ -132,7 +132,7 @@ public class DiskBrowser extends JFrame
|
|||||||
|
|
||||||
menuHandler.fontAction.addFontChangeListener (dataPanel);
|
menuHandler.fontAction.addFontChangeListener (dataPanel);
|
||||||
menuHandler.fontAction.addFontChangeListener (catalogPanel);
|
menuHandler.fontAction.addFontChangeListener (catalogPanel);
|
||||||
// menuHandler.fontAction.addFontChangeListener (diskLayoutPanel);
|
// menuHandler.fontAction.addFontChangeListener (diskLayoutPanel);
|
||||||
|
|
||||||
// set the MenuItem Actions
|
// set the MenuItem Actions
|
||||||
menuHandler.printItem.setAction (print);
|
menuHandler.printItem.setAction (print);
|
||||||
@ -166,7 +166,7 @@ public class DiskBrowser extends JFrame
|
|||||||
|
|
||||||
if (desktop.isSupported (Desktop.Action.APP_QUIT_HANDLER))
|
if (desktop.isSupported (Desktop.Action.APP_QUIT_HANDLER))
|
||||||
desktop.setQuitHandler ( (e, r) -> fireQuitEvent ()); // needed for cmd-Q
|
desktop.setQuitHandler ( (e, r) -> fireQuitEvent ()); // needed for cmd-Q
|
||||||
// else
|
// else
|
||||||
setQuitHandler (); // needed for the close button
|
setQuitHandler (); // needed for the close button
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -290,11 +290,11 @@ public class DiskBrowser extends JFrame
|
|||||||
private static void setLookAndFeel ()
|
private static void setLookAndFeel ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
// FlatLightLaf.install ();
|
// FlatLightLaf.install ();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());
|
UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());
|
||||||
// UIManager.setLookAndFeel (new FlatLightLaf ());
|
// UIManager.setLookAndFeel (new FlatLightLaf ());
|
||||||
if (MAC)
|
if (MAC)
|
||||||
System.setProperty ("apple.laf.useScreenMenuBar", "true");
|
System.setProperty ("apple.laf.useScreenMenuBar", "true");
|
||||||
}
|
}
|
||||||
|
@ -38,9 +38,15 @@ public class EnvironmentAction extends AbstractAction
|
|||||||
textFormatter.addLine ("Java version", System.getProperty ("java.runtime.version"));
|
textFormatter.addLine ("Java version", System.getProperty ("java.runtime.version"));
|
||||||
textFormatter.addLine ();
|
textFormatter.addLine ();
|
||||||
|
|
||||||
|
String userHome = System.getProperty ("user.home");
|
||||||
|
|
||||||
String path = System.getProperty ("java.class.path");
|
String path = System.getProperty ("java.class.path");
|
||||||
for (String s : path.split (File.pathSeparator))
|
for (String s : path.split (File.pathSeparator))
|
||||||
|
{
|
||||||
|
if (s.startsWith (userHome))
|
||||||
|
s = "~" + s.substring (userHome.length ());
|
||||||
textFormatter.addLine ("Classpath", s);
|
textFormatter.addLine ("Classpath", s);
|
||||||
|
}
|
||||||
|
|
||||||
JOptionPane.showMessageDialog (null, textFormatter.toLabel (), "Java Environment",
|
JOptionPane.showMessageDialog (null, textFormatter.toLabel (), "Java Environment",
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
Loading…
Reference in New Issue
Block a user