mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2025-01-09 18:33:28 +00:00
Preparing for internationalization as well as responding to the tighter
Eclipse 3.0 code checks.
This commit is contained in:
parent
7503a1ce86
commit
991316badf
src/com/webcodepro/applecommander
storage/filters/imagehandlers
ui/swt/wizard/diskimage
@ -48,7 +48,7 @@ public abstract class AppleImage {
|
||||
*/
|
||||
public static AppleImage create(int width, int height) {
|
||||
String[] classes = {
|
||||
"ImageIoImage", "SunJpegImage", "SwtImage" };
|
||||
"ImageIoImage", "SunJpegImage", "SwtImage" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
Class[] constructorArgClasses = new Class[] {
|
||||
int.class, int.class };
|
||||
Object[] constructorArgs = new Object[] {
|
||||
@ -56,7 +56,7 @@ public abstract class AppleImage {
|
||||
for (int i=0; i<classes.length; i++) {
|
||||
try {
|
||||
Class appleImageClass = Class.forName(
|
||||
"com.webcodepro.applecommander.storage.filters.imagehandlers."
|
||||
"com.webcodepro.applecommander.storage.filters.imagehandlers." //$NON-NLS-1$
|
||||
+ classes[i]);
|
||||
Constructor constructor =
|
||||
appleImageClass.getConstructor(constructorArgClasses);
|
||||
|
@ -40,8 +40,10 @@ public class ImageIoImage extends AppleImage {
|
||||
* as well as sets up the class.
|
||||
*/
|
||||
public ImageIoImage(int width, int height) throws ClassNotFoundException {
|
||||
super(new String[] { "PNG", "JPEG" });
|
||||
Class.forName("javax.imageio.ImageIO");
|
||||
// This lists all permutations of a format (ie, JPG, jpg, JPEG, jpeg, PNG, png):
|
||||
// super(ImageIO.getWriterFormatNames());
|
||||
super(new String[] { "PNG", "JPEG" }); //$NON-NLS-1$//$NON-NLS-2$
|
||||
Class.forName("javax.imageio.ImageIO"); //$NON-NLS-1$
|
||||
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
}
|
||||
/**
|
||||
|
@ -40,8 +40,8 @@ public class SunJpegImage extends AppleImage {
|
||||
* as well as sets up the class.
|
||||
*/
|
||||
public SunJpegImage(int width, int height) throws ClassNotFoundException {
|
||||
super(new String[] { "JPEG" });
|
||||
Class.forName("com.sun.image.codec.jpeg.JPEGCodec");
|
||||
super(new String[] { "JPEG" }); //$NON-NLS-1$
|
||||
Class.forName("com.sun.image.codec.jpeg.JPEGCodec"); //$NON-NLS-1$
|
||||
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
|
||||
}
|
||||
/**
|
||||
|
@ -27,7 +27,8 @@ import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.webcodepro.applecommander.storage.FormattedDisk;
|
||||
import com.webcodepro.applecommander.storage.Disk;
|
||||
import com.webcodepro.applecommander.ui.TextBundle;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
|
||||
/**
|
||||
@ -38,6 +39,7 @@ import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
* @author Rob Greene
|
||||
*/
|
||||
public class DiskImageFormatPane extends WizardPane {
|
||||
private TextBundle textBundle = TextBundle.getInstance();
|
||||
private DiskImageWizard wizard;
|
||||
private Composite control;
|
||||
private Composite parent;
|
||||
@ -60,15 +62,15 @@ public class DiskImageFormatPane extends WizardPane {
|
||||
case DiskImageWizard.FORMAT_RDOS:
|
||||
case DiskImageWizard.FORMAT_CPM:
|
||||
wizard.setOrder(DiskImageWizard.ORDER_DOS);
|
||||
wizard.setSize(FormattedDisk.APPLE_140KB_DISK);
|
||||
wizard.setSize(Disk.APPLE_140KB_DISK);
|
||||
return new DiskImageNamePane(parent, wizard);
|
||||
case DiskImageWizard.FORMAT_UNIDOS:
|
||||
wizard.setOrder(DiskImageWizard.ORDER_DOS);
|
||||
wizard.setSize(FormattedDisk.APPLE_800KB_2IMG_DISK);
|
||||
wizard.setSize(Disk.APPLE_800KB_2IMG_DISK);
|
||||
return new DiskImageNamePane(parent, wizard);
|
||||
case DiskImageWizard.FORMAT_OZDOS:
|
||||
wizard.setOrder(DiskImageWizard.ORDER_PRODOS);
|
||||
wizard.setSize(FormattedDisk.APPLE_800KB_2IMG_DISK);
|
||||
wizard.setSize(Disk.APPLE_800KB_2IMG_DISK);
|
||||
return new DiskImageNamePane(parent, wizard);
|
||||
case DiskImageWizard.FORMAT_PASCAL:
|
||||
case DiskImageWizard.FORMAT_PRODOS:
|
||||
@ -94,39 +96,33 @@ public class DiskImageFormatPane extends WizardPane {
|
||||
control.setLayout(layout);
|
||||
Label label = new Label(control, SWT.WRAP);
|
||||
label.setText(
|
||||
"Please choose the operating system with which to format\nthe disk image:");
|
||||
textBundle.get("DiskImageFormatPrompt")); //$NON-NLS-1$
|
||||
RowLayout subpanelLayout = new RowLayout(SWT.VERTICAL);
|
||||
subpanelLayout.justify = true;
|
||||
subpanelLayout.spacing = 3;
|
||||
Composite buttonSubpanel = new Composite(control, SWT.NULL);
|
||||
buttonSubpanel.setLayout(subpanelLayout);
|
||||
createRadioButton(buttonSubpanel, "DOS 3.3", DiskImageWizard.FORMAT_DOS33,
|
||||
"This is Apple's DOS 3.3 format. The disk will automatically be\n"
|
||||
+ "sized at 140K.");
|
||||
createRadioButton(buttonSubpanel, "UniDOS", DiskImageWizard.FORMAT_UNIDOS,
|
||||
"UniDOS was created to allow DOS 3.3 to operate with 800K disk\n"
|
||||
+ "drives. The disk will default to 800K.");
|
||||
createRadioButton(buttonSubpanel, "OzDOS", DiskImageWizard.FORMAT_OZDOS,
|
||||
"OzDOS was created to allow DOS 3.3 to operate with 800K disk\n"
|
||||
+ "drives. The disk will default to 800K.");
|
||||
createRadioButton(buttonSubpanel, "ProDOS", DiskImageWizard.FORMAT_PRODOS,
|
||||
"ProDOS was (is?) Apple's professional DOS for the Apple ][ series\n"
|
||||
+ "of computers. ProDOS allows subdirectories and can use devices\n"
|
||||
+ "up to 32MB in size. You will be presented with image sizing\n"
|
||||
+ "options from the 140K disk to a 32MB hard disk.");
|
||||
createRadioButton(buttonSubpanel, "Pascal", DiskImageWizard.FORMAT_PASCAL,
|
||||
"Apple Pascal formatted disks are part of the Pascal environment.\n"
|
||||
+ "Early implementations of Pascal only allowed 140K volumes, but\n"
|
||||
+ "later versions allowed 800K volumes (and possibly more). You\n"
|
||||
+ "will be presented with options for 140K or 800K.");
|
||||
createRadioButton(buttonSubpanel, "RDOS 2.1", DiskImageWizard.FORMAT_RDOS,
|
||||
"RDOS was created by (or for) SSI to protected their games. The\n"
|
||||
+ "original format appears to be a 13 sector disk. Most disk images\n"
|
||||
+ "that I've seen have been mapped onto a 16 sector disk (leaving 3\n"
|
||||
+ "sectors of each track unused. The only image size RDOS supports\n"
|
||||
+ "is 140K.");
|
||||
createRadioButton(buttonSubpanel, "CP/M", DiskImageWizard.FORMAT_CPM,
|
||||
"CP/M for the Apple computer.");
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Dos"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_DOS33,
|
||||
textBundle.get("DiskImageFormatDosTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Unidos"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_UNIDOS,
|
||||
textBundle.get("DiskImageFormatUnidosTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Ozdos"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_OZDOS,
|
||||
textBundle.get("DiskImageFormatOzdosTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Prodos"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_PRODOS,
|
||||
textBundle.get("DiskImageFormatProdosTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Pascal"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_PASCAL,
|
||||
textBundle.get("DiskImageFormatPascalTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Rdos"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_RDOS,
|
||||
textBundle.get("DiskImageFormatRdosTooltip")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("Cpm"), //$NON-NLS-1$
|
||||
DiskImageWizard.FORMAT_CPM,
|
||||
textBundle.get("DiskImageFormatCpmTooltip")); //$NON-NLS-1$
|
||||
control.pack();
|
||||
}
|
||||
/**
|
||||
@ -141,7 +137,7 @@ public class DiskImageFormatPane extends WizardPane {
|
||||
button.setToolTipText(helpText);
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
wizard.setFormat(format);
|
||||
getWizard().setFormat(format);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -151,4 +147,8 @@ public class DiskImageFormatPane extends WizardPane {
|
||||
public void dispose() {
|
||||
control.dispose();
|
||||
}
|
||||
|
||||
protected DiskImageWizard getWizard() {
|
||||
return wizard;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.webcodepro.applecommander.ui.TextBundle;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
|
||||
/**
|
||||
@ -38,6 +39,7 @@ import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
* @author Rob Greene
|
||||
*/
|
||||
public class DiskImageNamePane extends WizardPane {
|
||||
private TextBundle textBundle = TextBundle.getInstance();
|
||||
private DiskImageWizard wizard;
|
||||
private Composite control;
|
||||
private Composite parent;
|
||||
@ -51,14 +53,14 @@ public class DiskImageNamePane extends WizardPane {
|
||||
}
|
||||
/**
|
||||
* Get the next visible pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#getNextPane()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#getNextPane()
|
||||
*/
|
||||
public WizardPane getNextPane() {
|
||||
return new DiskImageOrderPane(parent, wizard);
|
||||
}
|
||||
/**
|
||||
* Create the wizard pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#open()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#open()
|
||||
*/
|
||||
public void open() {
|
||||
control = new Composite(parent, SWT.NULL);
|
||||
@ -74,9 +76,7 @@ public class DiskImageNamePane extends WizardPane {
|
||||
control.setLayout(layout);
|
||||
Label label = new Label(control, SWT.WRAP);
|
||||
label.setText(
|
||||
"Please choose a name for your disk image.\n"
|
||||
+ "Do not enter any file extensions, as the wizard\n"
|
||||
+ "will do that for you.");
|
||||
textBundle.get("DiskImageNamePrompt")); //$NON-NLS-1$
|
||||
final Text filename = new Text(control, SWT.BORDER);
|
||||
filename.setFocus();
|
||||
RowData rowData = new RowData();
|
||||
@ -85,23 +85,25 @@ public class DiskImageNamePane extends WizardPane {
|
||||
filename.setText(wizard.getFileName());
|
||||
filename.addKeyListener(new KeyAdapter() {
|
||||
public void keyPressed(KeyEvent event) {
|
||||
wizard.setFileName(filename.getText());
|
||||
getWizard().setFileName(filename.getText());
|
||||
setButtonStatus();
|
||||
}
|
||||
});
|
||||
if (wizard.isFormatProdos() || wizard.isFormatPascal()) {
|
||||
int maxLength = wizard.isFormatProdos() ? 15 : 7;
|
||||
label = new Label(control, SWT.WRAP);
|
||||
label.setText(
|
||||
(wizard.isFormatProdos() ? "ProDOS" : "Pascal")
|
||||
+ " requires a volume name.\nThe maximum length"
|
||||
+ " of the name is " + maxLength + " characters.");
|
||||
Object[] objects = new Object[2];
|
||||
objects[0] = wizard.isFormatProdos() ? textBundle.get("Prodos") //$NON-NLS-1$
|
||||
: textBundle.get("Pascal"); //$NON-NLS-1$
|
||||
objects[1] = new Integer(maxLength);
|
||||
label.setText(textBundle.format(
|
||||
"DiskImageNameLengthText", objects)); //$NON-NLS-1$
|
||||
final Text volumename = new Text(control, SWT.BORDER);
|
||||
volumename.setText(wizard.getVolumeName());
|
||||
volumename.setTextLimit(maxLength);
|
||||
volumename.addKeyListener(new KeyAdapter() {
|
||||
public void keyPressed(KeyEvent event) {
|
||||
wizard.setVolumeName(volumename.getText().toUpperCase());
|
||||
getWizard().setVolumeName(volumename.getText().toUpperCase());
|
||||
setButtonStatus();
|
||||
}
|
||||
});
|
||||
@ -123,9 +125,13 @@ public class DiskImageNamePane extends WizardPane {
|
||||
}
|
||||
/**
|
||||
* Dispose of all resources.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#dispose()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
control.dispose();
|
||||
}
|
||||
|
||||
protected DiskImageWizard getWizard() {
|
||||
return wizard;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.webcodepro.applecommander.storage.Disk;
|
||||
import com.webcodepro.applecommander.ui.TextBundle;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
|
||||
/**
|
||||
@ -38,6 +39,7 @@ import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
* @author Rob Greene
|
||||
*/
|
||||
public class DiskImageOrderPane extends WizardPane {
|
||||
private TextBundle textBundle = TextBundle.getInstance();
|
||||
private DiskImageWizard wizard;
|
||||
private Composite control;
|
||||
private Composite parent;
|
||||
@ -51,14 +53,14 @@ public class DiskImageOrderPane extends WizardPane {
|
||||
}
|
||||
/**
|
||||
* Get the next visible pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#getNextPane()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#getNextPane()
|
||||
*/
|
||||
public WizardPane getNextPane() {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Create the wizard pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#open()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#open()
|
||||
*/
|
||||
public void open() {
|
||||
control = new Composite(parent, SWT.NULL);
|
||||
@ -74,44 +76,41 @@ public class DiskImageOrderPane extends WizardPane {
|
||||
control.setLayout(layout);
|
||||
Label label = new Label(control, SWT.WRAP);
|
||||
if (wizard.isHardDisk()) {
|
||||
label.setText("You have chosen a hard disk volume. The only\n"
|
||||
+ "order allowed is ProDOS.");
|
||||
label.setText(textBundle.get("DiskImageOrderProdosOnly")); //$NON-NLS-1$
|
||||
} else {
|
||||
label.setText("Please choose the order to use in this disk image:");
|
||||
label.setText(textBundle.get("DiskImageOrderPrompt")); //$NON-NLS-1$
|
||||
}
|
||||
RowLayout subpanelLayout = new RowLayout(SWT.VERTICAL);
|
||||
subpanelLayout.justify = true;
|
||||
subpanelLayout.spacing = 3;
|
||||
Composite buttonSubpanel = new Composite(control, SWT.NULL);
|
||||
buttonSubpanel.setLayout(subpanelLayout);
|
||||
createRadioButton(buttonSubpanel, "DOS ordered",
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageOrderDosLabel"), //$NON-NLS-1$
|
||||
DiskImageWizard.ORDER_DOS,
|
||||
"Indicates that image data should be stored by track and sector.");
|
||||
createRadioButton(buttonSubpanel, "ProDOS ordered",
|
||||
textBundle.get("DiskImageOrderDosText")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageOrderProdosLabel"), //$NON-NLS-1$
|
||||
DiskImageWizard.ORDER_PRODOS,
|
||||
"Indicates that image data should be stored by block.");
|
||||
textBundle.get("DiskImageOrderProdosText")); //$NON-NLS-1$
|
||||
if (wizard.getSize() == Disk.APPLE_140KB_DISK) {
|
||||
createRadioButton(buttonSubpanel, "Nibble ordered",
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageOrderNibbleLabel"), //$NON-NLS-1$
|
||||
DiskImageWizard.ORDER_NIBBLE,
|
||||
"Indicates that this is a disk stored as a nibble image. This is "
|
||||
+ "an image that consists of disk bytes. It is only available for "
|
||||
+ "140KB 5.25\" disks.");
|
||||
textBundle.get("DiskImageOrderNibbleText")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
label = new Label(control, SWT.WRAP);
|
||||
if (wizard.isHardDisk()) {
|
||||
label.setText("Compression is not available for hard disk images.");
|
||||
label.setText(textBundle.get("DiskImageOrderNoCompression")); //$NON-NLS-1$
|
||||
} else {
|
||||
label.setText("Indicate if this disk image should be GZIP compressed:");
|
||||
label.setText(textBundle.get("DiskImageOrderCompressionPrompt")); //$NON-NLS-1$
|
||||
}
|
||||
final Button button = new Button(control, SWT.CHECK);
|
||||
button.setText("GZip compression");
|
||||
button.setToolTipText("Compresses the disk image (*.gz).");
|
||||
button.setText(textBundle.get("DiskImageOrderGzipCheckbox")); //$NON-NLS-1$
|
||||
button.setToolTipText(textBundle.get("DiskImageOrderGzipTooltip")); //$NON-NLS-1$
|
||||
button.setSelection(wizard.isCompressed());
|
||||
button.setEnabled(!wizard.isHardDisk());
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
wizard.setCompressed(!wizard.isCompressed());
|
||||
getWizard().setCompressed(!getWizard().isCompressed());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -128,15 +127,19 @@ public class DiskImageOrderPane extends WizardPane {
|
||||
button.setEnabled(!wizard.isHardDisk());
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
wizard.setOrder(order);
|
||||
getWizard().setOrder(order);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Dispose of all resources.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#dispose()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
control.dispose();
|
||||
}
|
||||
|
||||
protected DiskImageWizard getWizard() {
|
||||
return wizard;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,8 @@ import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import com.webcodepro.applecommander.storage.FormattedDisk;
|
||||
import com.webcodepro.applecommander.storage.Disk;
|
||||
import com.webcodepro.applecommander.ui.TextBundle;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
|
||||
/**
|
||||
@ -37,6 +38,7 @@ import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
* @author Rob Greene
|
||||
*/
|
||||
public class DiskImageSizePane extends WizardPane {
|
||||
private TextBundle textBundle = TextBundle.getInstance();
|
||||
private DiskImageWizard wizard;
|
||||
private Composite control;
|
||||
private Composite parent;
|
||||
@ -50,14 +52,14 @@ public class DiskImageSizePane extends WizardPane {
|
||||
}
|
||||
/**
|
||||
* Get the next visible pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#getNextPane()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#getNextPane()
|
||||
*/
|
||||
public WizardPane getNextPane() {
|
||||
return new DiskImageNamePane(parent, wizard);
|
||||
}
|
||||
/**
|
||||
* Create the wizard pane.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#open()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#open()
|
||||
*/
|
||||
public void open() {
|
||||
control = new Composite(parent, SWT.NULL);
|
||||
@ -73,25 +75,31 @@ public class DiskImageSizePane extends WizardPane {
|
||||
control.setLayout(layout);
|
||||
Label label = new Label(control, SWT.WRAP);
|
||||
label.setText(
|
||||
"Please choose the disk image size:");
|
||||
textBundle.get("DiskImageSizePrompt")); //$NON-NLS-1$
|
||||
RowLayout subpanelLayout = new RowLayout(SWT.VERTICAL);
|
||||
subpanelLayout.justify = true;
|
||||
subpanelLayout.spacing = 3;
|
||||
Composite buttonSubpanel = new Composite(control, SWT.NULL);
|
||||
buttonSubpanel.setLayout(subpanelLayout);
|
||||
createRadioButton(buttonSubpanel, "140KB", FormattedDisk.APPLE_140KB_DISK,
|
||||
"The Disk II 5.25\" floppy drive.");
|
||||
createRadioButton(buttonSubpanel, "800KB", FormattedDisk.APPLE_800KB_2IMG_DISK,
|
||||
"The Apple UniDisk 3.5\" drive.");
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize140Kb"), //$NON-NLS-1$
|
||||
Disk.APPLE_140KB_DISK,
|
||||
textBundle.get("DiskImageSize140KbText")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize800Kb"), //$NON-NLS-1$
|
||||
Disk.APPLE_800KB_2IMG_DISK,
|
||||
textBundle.get("DiskImageSize800KbText")); //$NON-NLS-1$
|
||||
if (wizard.getFormat() == DiskImageWizard.FORMAT_PRODOS) {
|
||||
createRadioButton(buttonSubpanel, "5MB", FormattedDisk.APPLE_5MB_HARDDISK,
|
||||
"A 5MB hard disk.");
|
||||
createRadioButton(buttonSubpanel, "10MB", FormattedDisk.APPLE_10MB_HARDDISK,
|
||||
"A 10MB hard disk.");
|
||||
createRadioButton(buttonSubpanel, "20MB", FormattedDisk.APPLE_20MB_HARDDISK,
|
||||
"A 20MB hard disk.");
|
||||
createRadioButton(buttonSubpanel, "32MB", FormattedDisk.APPLE_32MB_HARDDISK,
|
||||
"A 32MB hard disk.");
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize5Mb"), //$NON-NLS-1$
|
||||
Disk.APPLE_5MB_HARDDISK,
|
||||
textBundle.get("DiskImageSize5MbText")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize10Mb"), //$NON-NLS-1$
|
||||
Disk.APPLE_10MB_HARDDISK,
|
||||
textBundle.get("DiskImageSize10MbText")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize20Mb"), //$NON-NLS-1$
|
||||
Disk.APPLE_20MB_HARDDISK,
|
||||
textBundle.get("DiskImageSize20MbText")); //$NON-NLS-1$
|
||||
createRadioButton(buttonSubpanel, textBundle.get("DiskImageSize32Mb"), //$NON-NLS-1$
|
||||
Disk.APPLE_32MB_HARDDISK,
|
||||
textBundle.get("DiskImageSize32MbText")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -106,15 +114,19 @@ public class DiskImageSizePane extends WizardPane {
|
||||
button.setSelection(wizard.getSize() == size);
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
wizard.setSize(size);
|
||||
getWizard().setSize(size);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Dispose of all resources.
|
||||
* @see com.webcodepro.applecommander.ui.swt.WizardPane#dispose()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#dispose()
|
||||
*/
|
||||
public void dispose() {
|
||||
control.dispose();
|
||||
}
|
||||
|
||||
protected DiskImageWizard getWizard() {
|
||||
return wizard;
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ import com.webcodepro.applecommander.storage.physical.DosOrder;
|
||||
import com.webcodepro.applecommander.storage.physical.ImageOrder;
|
||||
import com.webcodepro.applecommander.storage.physical.NibbleOrder;
|
||||
import com.webcodepro.applecommander.storage.physical.ProdosOrder;
|
||||
import com.webcodepro.applecommander.ui.TextBundle;
|
||||
import com.webcodepro.applecommander.ui.swt.util.ImageManager;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.Wizard;
|
||||
import com.webcodepro.applecommander.ui.swt.wizard.WizardPane;
|
||||
@ -57,20 +58,21 @@ public class DiskImageWizard extends Wizard {
|
||||
public static final int ORDER_PRODOS = 2;
|
||||
public static final int ORDER_NIBBLE = 3;
|
||||
private int format = FORMAT_DOS33;
|
||||
private int size = FormattedDisk.APPLE_140KB_DISK;
|
||||
private String fileName = "";
|
||||
private String volumeName = "";
|
||||
private int size = Disk.APPLE_140KB_DISK;
|
||||
private String fileName = new String();
|
||||
private String volumeName = new String();
|
||||
private int order = ORDER_PRODOS;
|
||||
private boolean compressed = false;
|
||||
/**
|
||||
* Constructor for ExportWizard.
|
||||
*/
|
||||
public DiskImageWizard(Shell parent, ImageManager imageManager) {
|
||||
super(parent, imageManager.get(ImageManager.LOGO_DISK_IMAGE_WIZARD), "Disk Image Wizard");
|
||||
super(parent, imageManager.get(ImageManager.LOGO_DISK_IMAGE_WIZARD),
|
||||
TextBundle.getInstance().get("DiskImageWizardTitle")); //$NON-NLS-1$
|
||||
}
|
||||
/**
|
||||
* Create the initial display used in the wizard.
|
||||
* @see com.webcodepro.applecommander.ui.swt.Wizard#createInitialWizardPane()
|
||||
* @see com.webcodepro.applecommander.ui.swt.wizard.Wizard#createInitialWizardPane()
|
||||
*/
|
||||
public WizardPane createInitialWizardPane() {
|
||||
return new DiskImageFormatPane(getContentPane(), this);
|
||||
@ -81,14 +83,14 @@ public class DiskImageWizard extends Wizard {
|
||||
public FormattedDisk[] getFormattedDisks() {
|
||||
StringBuffer name = new StringBuffer(fileName);
|
||||
if (isHardDisk()) {
|
||||
name.append(".hdv");
|
||||
name.append(".hdv"); //$NON-NLS-1$
|
||||
} else if (order == ORDER_DOS) {
|
||||
name.append(".dsk");
|
||||
name.append(".dsk"); //$NON-NLS-1$
|
||||
} else {
|
||||
name.append(".po");
|
||||
name.append(".po"); //$NON-NLS-1$
|
||||
}
|
||||
if (isCompressed()) {
|
||||
name.append(".gz");
|
||||
name.append(".gz"); //$NON-NLS-1$
|
||||
}
|
||||
ByteArrayImageLayout imageLayout = new ByteArrayImageLayout(getSize());
|
||||
ImageOrder imageOrder = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user