mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-10 00:30:58 +00:00
tidying
This commit is contained in:
parent
70ce17e082
commit
2f3ab4db89
@ -128,7 +128,6 @@ public class DiskBrowser extends JFrame implements DiskSelectionListener, QuitLi
|
|||||||
quitAction.addQuitListener (menuHandler);
|
quitAction.addQuitListener (menuHandler);
|
||||||
quitAction.addQuitListener (menuHandler.fontAction);
|
quitAction.addQuitListener (menuHandler.fontAction);
|
||||||
quitAction.addQuitListener (catalogPanel);
|
quitAction.addQuitListener (catalogPanel);
|
||||||
quitAction.addQuitListener (diskLayoutPanel);
|
|
||||||
quitAction.addQuitListener (this);
|
quitAction.addQuitListener (this);
|
||||||
|
|
||||||
if (Platform.MAC)
|
if (Platform.MAC)
|
||||||
|
@ -18,7 +18,6 @@ import javax.swing.JComponent;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
|
||||||
import com.bytezone.common.QuitAction.QuitListener;
|
|
||||||
import com.bytezone.diskbrowser.disk.Disk;
|
import com.bytezone.diskbrowser.disk.Disk;
|
||||||
import com.bytezone.diskbrowser.disk.DiskAddress;
|
import com.bytezone.diskbrowser.disk.DiskAddress;
|
||||||
import com.bytezone.diskbrowser.disk.DualDosDisk;
|
import com.bytezone.diskbrowser.disk.DualDosDisk;
|
||||||
@ -27,14 +26,9 @@ import com.bytezone.diskbrowser.gui.RedoHandler.RedoEvent;
|
|||||||
import com.bytezone.diskbrowser.gui.RedoHandler.RedoListener;
|
import com.bytezone.diskbrowser.gui.RedoHandler.RedoListener;
|
||||||
|
|
||||||
class DiskLayoutPanel extends JPanel
|
class DiskLayoutPanel extends JPanel
|
||||||
implements DiskSelectionListener, FileSelectionListener, RedoListener, QuitListener
|
implements DiskSelectionListener, FileSelectionListener, RedoListener
|
||||||
//, FontChangeListener
|
|
||||||
{
|
{
|
||||||
private static final int SIZE = 15; // basic unit of a display block
|
private static final int SIZE = 15; // basic unit of a display block
|
||||||
// private static final String PREFS_RETINA = "retina";
|
|
||||||
|
|
||||||
// private final Preferences prefs;
|
|
||||||
// private final MenuHandler mh;
|
|
||||||
|
|
||||||
private final DiskLayoutImage diskLayoutImage;
|
private final DiskLayoutImage diskLayoutImage;
|
||||||
private final ScrollRuler verticalRuler;
|
private final ScrollRuler verticalRuler;
|
||||||
@ -47,9 +41,6 @@ class DiskLayoutPanel extends JPanel
|
|||||||
{
|
{
|
||||||
super (new BorderLayout ());
|
super (new BorderLayout ());
|
||||||
|
|
||||||
// this.prefs = prefs;
|
|
||||||
// this.mh = mh;
|
|
||||||
|
|
||||||
diskLayoutImage = new DiskLayoutImage ();
|
diskLayoutImage = new DiskLayoutImage ();
|
||||||
verticalRuler = new ScrollRuler (diskLayoutImage, ScrollRuler.VERTICAL);
|
verticalRuler = new ScrollRuler (diskLayoutImage, ScrollRuler.VERTICAL);
|
||||||
horizontalRuler = new ScrollRuler (diskLayoutImage, ScrollRuler.HORIZONTAL);
|
horizontalRuler = new ScrollRuler (diskLayoutImage, ScrollRuler.HORIZONTAL);
|
||||||
@ -241,25 +232,4 @@ class DiskLayoutPanel extends JPanel
|
|||||||
legendPanel.setDisk (newDisk, layout);
|
legendPanel.setDisk (newDisk, layout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void quit (Preferences arg0)
|
|
||||||
{
|
|
||||||
// prefs.putBoolean (PREFS_RETINA, mh.retinaItem.isSelected ());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restore (Preferences arg0)
|
|
||||||
{
|
|
||||||
// mh.retinaItem.setSelected (prefs.getBoolean (PREFS_RETINA, false));
|
|
||||||
// setRetina (mh.retinaItem.isSelected ());
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void changeFont (FontChangeEvent e)
|
|
||||||
// {
|
|
||||||
// // verticalRuler.changeFont (e.font);
|
|
||||||
// // horizontalRuler.changeFont (e.font);
|
|
||||||
// // legendPanel.changeFont (e.font);
|
|
||||||
// }
|
|
||||||
}
|
}
|
@ -14,8 +14,8 @@ public class DiskPanel extends JPanel
|
|||||||
FormattedDisk formattedDisk;
|
FormattedDisk formattedDisk;
|
||||||
LayoutDetails layoutDetails;
|
LayoutDetails layoutDetails;
|
||||||
boolean isRetina;
|
boolean isRetina;
|
||||||
int blockWidth = 30; // default
|
int blockWidth = 30; // default
|
||||||
int blockHeight = 15; // default
|
int blockHeight = 15; // default
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int offset;
|
int offset;
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package com.bytezone.diskbrowser.gui;
|
package com.bytezone.diskbrowser.gui;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
|
||||||
@ -43,9 +47,11 @@ class ScrollRuler extends JComponent
|
|||||||
|
|
||||||
// Must match the preferred size of DiskLayoutImage
|
// Must match the preferred size of DiskLayoutImage
|
||||||
if (orientation == HORIZONTAL)
|
if (orientation == HORIZONTAL)
|
||||||
setPreferredSize (new Dimension (layout.block.width * layout.grid.width + 1, HEIGHT));
|
setPreferredSize (
|
||||||
|
new Dimension (layout.block.width * layout.grid.width + 1, HEIGHT));
|
||||||
else
|
else
|
||||||
setPreferredSize (new Dimension (WIDTH, layout.block.height * layout.grid.height + 1));
|
setPreferredSize (
|
||||||
|
new Dimension (WIDTH, layout.block.height * layout.grid.height + 1));
|
||||||
|
|
||||||
setTrackMode (layout.grid.width == 16 || layout.grid.width == 13);
|
setTrackMode (layout.grid.width == 16 || layout.grid.width == 13);
|
||||||
}
|
}
|
||||||
@ -56,13 +62,6 @@ class ScrollRuler extends JComponent
|
|||||||
repaint ();
|
repaint ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void changeFont (Font font)
|
|
||||||
// {
|
|
||||||
// System.out.println (font);
|
|
||||||
// this.font = font;
|
|
||||||
// repaint ();
|
|
||||||
// }
|
|
||||||
|
|
||||||
public void setHex (boolean hex)
|
public void setHex (boolean hex)
|
||||||
{
|
{
|
||||||
isHex = hex;
|
isHex = hex;
|
||||||
@ -73,7 +72,6 @@ class ScrollRuler extends JComponent
|
|||||||
protected void paintComponent (Graphics g)
|
protected void paintComponent (Graphics g)
|
||||||
{
|
{
|
||||||
Rectangle clipRect = g.getClipBounds ();
|
Rectangle clipRect = g.getClipBounds ();
|
||||||
// g.setColor (new Color (240, 240, 240));
|
|
||||||
g.setColor (Color.WHITE);
|
g.setColor (Color.WHITE);
|
||||||
g.fillRect (clipRect.x, clipRect.y, clipRect.width, clipRect.height);
|
g.fillRect (clipRect.x, clipRect.y, clipRect.width, clipRect.height);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user