made some functions visible for Wizardry Disk Browser

This commit is contained in:
Denis Molony 2022-01-27 13:14:07 +10:00
parent 6dfc72b2d2
commit e67bbeaf8b
2 changed files with 11 additions and 14 deletions

View File

@ -52,7 +52,7 @@ public class DiskBrowser extends JFrame
{
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]))
new WindowState (prefs).clear ();
@ -113,8 +113,8 @@ public class DiskBrowser extends JFrame
catalogPanel.addDiskSelectionListener (this, dataPanel, diskLayoutPanel, redoHandler,
menuHandler, menuHandler.saveDiskAction);
catalogPanel.addFileSelectionListener (dataPanel, diskLayoutPanel, redoHandler,
menuHandler, menuHandler.saveFileAction);
catalogPanel.addFileSelectionListener (dataPanel, diskLayoutPanel, redoHandler, menuHandler,
menuHandler.saveFileAction);
catalogPanel.addFileNodeSelectionListener (dataPanel, redoHandler);
@ -160,9 +160,9 @@ public class DiskBrowser extends JFrame
"Author - Denis Molony\nGitHub - https://github.com/dmolony/DiskBrowser",
"About DiskBrowser", JOptionPane.INFORMATION_MESSAGE));
if (desktop.isSupported (Desktop.Action.APP_PREFERENCES) && false)
desktop.setPreferencesHandler (
e -> JOptionPane.showMessageDialog (null, "Preferences dialog"));
// if (desktop.isSupported (Desktop.Action.APP_PREFERENCES) && false)
// desktop.setPreferencesHandler (
// e -> JOptionPane.showMessageDialog (null, "Preferences dialog"));
if (desktop.isSupported (Desktop.Action.APP_QUIT_HANDLER))
desktop.setQuitHandler ( (e, r) -> fireQuitEvent ()); // needed for cmd-Q
@ -265,8 +265,7 @@ public class DiskBrowser extends JFrame
public void diskSelected (DiskSelectedEvent e)
// ---------------------------------------------------------------------------------//
{
setTitle (windowTitle + e.getFormattedDisk () == null ? ""
: e.getFormattedDisk ().getName ());
setTitle (windowTitle + e.getFormattedDisk () == null ? "" : e.getFormattedDisk ().getName ());
}
// ---------------------------------------------------------------------------------//

View File

@ -28,14 +28,14 @@ public class ImagePanel extends JPanel
}
// ---------------------------------------------------------------------------------//
void setScale (double scale)
public void setScale (double scale)
// ---------------------------------------------------------------------------------//
{
this.userScale = scale;
}
// ---------------------------------------------------------------------------------//
void setImage (BufferedImage image)
public void setImage (BufferedImage image)
// ---------------------------------------------------------------------------------//
{
this.image = image;
@ -44,8 +44,7 @@ public class ImagePanel extends JPanel
if (image != null)
{
Graphics2D g2 = image.createGraphics ();
g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
width = image.getWidth ();
height = image.getHeight ();
}
@ -79,8 +78,7 @@ public class ImagePanel extends JPanel
{
Graphics2D g2 = ((Graphics2D) g);
g2.transform (AffineTransform.getScaleInstance (scale, scale));
g2.drawImage (image, (int) ((getWidth () - image.getWidth () * scale) / 2 / scale),
4, this);
g2.drawImage (image, (int) ((getWidth () - image.getWidth () * scale) / 2 / scale), 4, this);
}
}
}