2020-02-08 22:20:08 +00:00
|
|
|
package com.bytezone.diskbrowser.gui;
|
|
|
|
|
|
|
|
import java.util.EventObject;
|
|
|
|
|
|
|
|
import com.bytezone.diskbrowser.applefile.AppleFileSource;
|
|
|
|
import com.bytezone.diskbrowser.disk.FormattedDisk;
|
2021-06-01 10:21:21 +00:00
|
|
|
import com.bytezone.diskbrowser.disk.HybridDisk;
|
2020-02-08 22:20:08 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------------//
|
|
|
|
class FileSelectedEvent extends EventObject
|
|
|
|
// -----------------------------------------------------------------------------------//
|
|
|
|
{
|
|
|
|
public final AppleFileSource appleFileSource;
|
|
|
|
boolean redo;
|
|
|
|
int volumeNo = -1;
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
FileSelectedEvent (Object source, AppleFileSource appleFileSource)
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
{
|
|
|
|
super (source);
|
|
|
|
this.appleFileSource = appleFileSource;
|
|
|
|
|
2021-06-01 10:21:21 +00:00
|
|
|
// If a file is selected from a disk which is part of a hybrid disk, then the
|
2021-06-04 06:53:04 +00:00
|
|
|
// parent must be told so that it can ensure its internal currentDisk is set
|
|
|
|
// correctly
|
2020-02-08 22:20:08 +00:00
|
|
|
FormattedDisk fd = appleFileSource.getFormattedDisk ();
|
2020-12-20 21:50:51 +00:00
|
|
|
HybridDisk ddd = (HybridDisk) fd.getParent ();
|
2020-02-08 22:20:08 +00:00
|
|
|
if (ddd != null)
|
|
|
|
{
|
|
|
|
ddd.setCurrentDisk (fd);
|
|
|
|
volumeNo = ddd.getCurrentDiskNo ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
public String toText ()
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
{
|
|
|
|
return appleFileSource.getUniqueName ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
@Override
|
|
|
|
public String toString ()
|
|
|
|
// ---------------------------------------------------------------------------------//
|
|
|
|
{
|
|
|
|
return appleFileSource.toString ();
|
|
|
|
}
|
2015-06-01 09:35:51 +00:00
|
|
|
}
|