mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-24 08:29:20 +00:00
enable cursor movement in catalog tree
This commit is contained in:
parent
0658fa4e7c
commit
557066e0f4
@ -137,6 +137,7 @@ abstract class AbstractTab extends JPanel implements Tab
|
||||
tree.setSelectionPath (tp);
|
||||
if (!tree.isVisible (tp))
|
||||
tree.scrollPathToVisible (tp);
|
||||
tree.requestFocusInWindow ();
|
||||
}
|
||||
|
||||
protected TreePath getPathToNode (DefaultMutableTreeNode selectNode)
|
||||
|
@ -18,8 +18,9 @@ import com.bytezone.diskbrowser.disk.FormattedDisk;
|
||||
import com.bytezone.diskbrowser.disk.SectorType;
|
||||
import com.bytezone.diskbrowser.gui.DiskLayoutPanel.LayoutDetails;
|
||||
import com.bytezone.diskbrowser.gui.RedoHandler.RedoEvent;
|
||||
import com.bytezone.diskbrowser.gui.RedoHandler.RedoListener;
|
||||
|
||||
class DiskLayoutImage extends JPanel implements Scrollable
|
||||
class DiskLayoutImage extends JPanel implements Scrollable, RedoListener
|
||||
{
|
||||
static final Cursor crosshairCursor = new Cursor (Cursor.CROSSHAIR_CURSOR);
|
||||
|
||||
@ -43,7 +44,7 @@ class DiskLayoutImage extends JPanel implements Scrollable
|
||||
setOpaque (true);
|
||||
|
||||
addKeyListener (new MyKeyListener ());
|
||||
setFocusable (true);
|
||||
// setFocusable (true);
|
||||
}
|
||||
|
||||
public void setDisk (FormattedDisk disk, LayoutDetails details)
|
||||
@ -205,7 +206,8 @@ class DiskLayoutImage extends JPanel implements Scrollable
|
||||
return false;
|
||||
}
|
||||
|
||||
void redoEvent (RedoEvent redoEvent)
|
||||
@Override
|
||||
public void redo (RedoEvent redoEvent)
|
||||
{
|
||||
redo = true;
|
||||
SectorSelectedEvent event = (SectorSelectedEvent) redoEvent.value;
|
||||
|
@ -224,7 +224,7 @@ class DiskLayoutPanel extends JPanel implements DiskSelectionListener,
|
||||
// This can happen if sectors are selected from a dual-dos disk
|
||||
checkCorrectDisk (((SectorSelectedEvent) event.value).getFormattedDisk ());
|
||||
|
||||
image.redoEvent (event);
|
||||
image.redo (event);
|
||||
}
|
||||
|
||||
private void checkCorrectDisk (FormattedDisk newDisk)
|
||||
|
Loading…
Reference in New Issue
Block a user