|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.TitleAreaDialog
com.groovemanager.app.mc909se.Export909SamplesDialog
This dialog is used for exporting samples from the Mc909 sample editor to the MC909 or for importing them from the 909 to the editor.
| Nested Class Summary |
|---|
| Nested classes inherited from class org.eclipse.jface.window.Window |
|---|
org.eclipse.jface.window.Window.IExceptionHandler |
| Field Summary | |
|---|---|
(package private) org.eclipse.swt.widgets.Button |
card
Radio button for user selection of "USB-Select" |
(package private) org.eclipse.swt.widgets.Button |
createPatches
Button for performing export |
(package private) org.eclipse.swt.widgets.Text |
directory
Text field for user input of the target path |
(package private) Mc909SampleEditor |
editor
The Mc909SampleEditor from whicht this dialog was opened |
(package private) org.eclipse.swt.widgets.Table |
existingSamples
Table of existing samples on the Mc909. |
(package private) java.lang.String |
exportPath
The path for sample export (Path to the Mc909īs root folder) |
(package private) org.eclipse.swt.widgets.List |
exportSamples
List displaying the currently opened samples to be selected for export. |
(package private) java.io.FilenameFilter |
fileNameFilter
FileNameFilter to be used for filtering out potential Mc909 samples |
(package private) org.eclipse.swt.widgets.Button |
internal
Radio button for user selection of "USB-Select" |
(package private) ScaleNum |
nextNum
ScaleNum for user selection of the next sample number used for export |
(package private) java.util.ArrayList |
properties
List of Mc909SampleEditor.Properties representing the currently opened samples |
(package private) static java.lang.String |
SMPL_FOLDER
Relative path from the Mc909īs root path to the sample directory |
| Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog |
|---|
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE |
| Fields inherited from class org.eclipse.jface.dialogs.Dialog |
|---|
buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING |
| Fields inherited from class org.eclipse.jface.window.Window |
|---|
CANCEL, OK |
| Constructor Summary | |
|---|---|
Export909SamplesDialog(org.eclipse.swt.widgets.Shell parentShell,
Mc909SampleEditor.Properties[] properties,
Mc909SampleEditor editor)
Create a new ExportSamplesDialog |
|
| Method Summary | |
|---|---|
private boolean |
askForOverwrite(int num,
java.lang.String samplename,
java.lang.String firstCollission,
java.lang.String secondCollission,
boolean stereo)
If a collossion between existing samples and samples to be exported is detected, this method can be used to ask, if the existing sample should be overwritten or not |
boolean |
close()
|
protected void |
createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
|
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent)
|
private void |
deleteItem(org.eclipse.swt.widgets.TableItem item)
Remove the given TableItem from the existing samples table |
void |
errorMessage(java.lang.String m)
Display an error message to the user |
private int |
export()
Try to export all samples that were marked for export. |
private java.io.File |
export(Mc909SampleEditor.Properties prop,
int sampleNum,
java.lang.String path)
Export one sample |
private static java.lang.String |
fillName(java.lang.String name)
Get a String of length 16 out of the given String. |
private void |
fillTable(java.lang.String path)
Fill the existing samples table if and only if the given path is other than the one used the last time for filling the table. |
private void |
fillTable(java.lang.String path,
boolean force)
Fill the existing samples table. |
private int |
getIndexForNum(int num)
Get the index of the TableItem containing the given sample number |
private org.eclipse.swt.widgets.TableItem |
getItemForNumber(int nr)
Get the TableItem containing the sample with the given sample nr. |
private java.lang.String |
getItemName(org.eclipse.swt.widgets.TableItem item)
Get a String describing the sample represented by the given TableItem |
private void |
importSamples(org.eclipse.swt.widgets.TableItem[] items)
Import the samples represented by the given TableItems from the Mc909 to the editor |
private org.eclipse.swt.widgets.TableItem |
insertItemAt(int pos)
Create a new Table Item and insert it into the existing samples table at the given index |
protected void |
okPressed()
|
private void |
transfer()
Move the selected samples from the open file list to the existing samples table to indicate that they will be exported when completing this dialog. |
private void |
transferOne(Mc909SampleEditor.Properties p,
int desiredNum)
Move a single sample from the opened files list to the table of samples to be exported |
private boolean |
tryToOverwrite(int num,
boolean stereo,
java.lang.String sampleName)
Find out, with which sample(s) the given sample number collides and try ask the user, if they should be overwritten. |
| Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog |
|---|
createContents, getInitialSize, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage |
| Methods inherited from class org.eclipse.jface.dialogs.Dialog |
|---|
applyDialogFont, buttonPressed, cancelPressed, configureShell, constrainShellSize, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createButtonBar, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, setButtonLayoutData, setButtonLayoutFormData |
| Methods inherited from class org.eclipse.jface.window.Window |
|---|
canHandleShellCloseEvent, create, createShell, getContents, getDefaultImage, getInitialLocation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
org.eclipse.swt.widgets.Button card
org.eclipse.swt.widgets.Button createPatches
org.eclipse.swt.widgets.Text directory
final Mc909SampleEditor editor
org.eclipse.swt.widgets.Table existingSamples
java.lang.String exportPath
org.eclipse.swt.widgets.List exportSamples
java.io.FilenameFilter fileNameFilter
org.eclipse.swt.widgets.Button internal
ScaleNum nextNum
java.util.ArrayList properties
static final java.lang.String SMPL_FOLDER
| Constructor Detail |
|---|
public Export909SamplesDialog(org.eclipse.swt.widgets.Shell parentShell,
Mc909SampleEditor.Properties[] properties,
Mc909SampleEditor editor)
parentShell - The shell to be used as parent shell for this dialogproperties - Array of all Mc909SampleEditor.Properties representing
the currently opened fileseditor - The Mc909SampleEditor from which this dialog was opened| Method Detail |
|---|
private boolean askForOverwrite(int num,
java.lang.String samplename,
java.lang.String firstCollission,
java.lang.String secondCollission,
boolean stereo)
num - The sample number where the sample should be exported tosamplename - The name of the sample to be exportedfirstCollission - The number and name of the first (and maybe only)
sample the exported one collides withsecondCollission - In some cases a stereo file might collide with
two samples at a time. In these cases, this parameter should contain the
second colliding existing sample. Otherwise it may be null.stereo - true, if the exported sample is stereo, false otherwise.
public boolean close()
close in class org.eclipse.jface.dialogs.Dialogprotected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
createButtonsForButtonBar in class org.eclipse.jface.dialogs.Dialogprotected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea in class org.eclipse.jface.dialogs.TitleAreaDialogprivate void deleteItem(org.eclipse.swt.widgets.TableItem item)
item - The TableItem to removepublic void errorMessage(java.lang.String m)
m - The message to displayprivate int export()
private java.io.File export(Mc909SampleEditor.Properties prop,
int sampleNum,
java.lang.String path)
throws java.io.IOException,
NotReadyException,
NotFinishedException
prop - The Properties object representing the file to exportsampleNum - The sample number to export topath - The Mc909īs root path to use for export
java.io.IOException - If an I/O error occurs
NotReadyException - If the sample could not be read
NotFinishedException - If the sample export operation could not be
finishedprivate static java.lang.String fillName(java.lang.String name)
name - The original String
private void fillTable(java.lang.String path)
path - The Mc909īs root path
private void fillTable(java.lang.String path,
boolean force)
force parameter
specifies, whether the table should be updated even if the path didnīt
change.
path - The Mc909īs root pathforce - true, if the tableīs content should be updated even if the
path didnīt change, false otherwiseprivate int getIndexForNum(int num)
num - The sample number to get the index for.
private org.eclipse.swt.widgets.TableItem getItemForNumber(int nr)
nr - The sample nr in question
null will be
returned.private java.lang.String getItemName(org.eclipse.swt.widgets.TableItem item)
item - The TableItem containing the sample
private void importSamples(org.eclipse.swt.widgets.TableItem[] items)
items - The TableItems selected for importprivate org.eclipse.swt.widgets.TableItem insertItemAt(int pos)
pos - The index where to insert the Item
protected void okPressed()
okPressed in class org.eclipse.jface.dialogs.Dialogprivate void transfer()
private void transferOne(Mc909SampleEditor.Properties p,
int desiredNum)
p - The Properties object representing the opened sampledesiredNum - The number, where to export the sample to
private boolean tryToOverwrite(int num,
boolean stereo,
java.lang.String sampleName)
num - The sample number in questionstereo - true, if the sample to export is stereo, false otherwisesampleName - The name of the sample to export
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||