JAL-3063 switched from castor to JAXB - backupFile bits added to jalview.project.Jalview2XML
-.project
+/*.project
+.classpath
/dist
/clover
/classes
/tests
/test-reports
/test-output
-.externalToolBuilders/Jalview Release indices [Builder].launch
+.externalToolBuilders/*
+.settings/*
/.DS_Store
.DS_Store
/.com.apple.timemachine.supported
--- /dev/null
+>BACKUP_FILES/1-6 backupfiles
+AAAARG
action.close_all = Close all
action.load_project = Load Project
action.save_project = Save Project
+action.save_project_as = Save Project as...
action.quit = Quit
action.expand_views = Expand Views
action.gather_views = Gather Views
label.most_polymer_residues = Most Polymer Residues
label.cached_structures = Cached Structures
label.free_text_search = Free Text Search
+label.backupfiles_confirm_delete = Confirm delete
+label.backupfiles_confirm_delete_old_files = Delete the following older backup files? (see the Backups tab in Preferences for more options)
+label.backupfiles_confirm_save_file = Confirm save file
+label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Something possibly went wrong with the backups of this file, write the new file anyway?
+label.backups = Backups
+label.backup_files = Backup Files
+label.enable_backupfiles = Enable backup files
+label.suffix_format = Suffix format
+label.suffix_template = Suffix template (use %n to represent the backup/version index)
+label.suffix_template_tooltip = %n in the template will be replaced by the index number. The suffix will appear before the filename extension.
+label.index_digits = Number of digits to use for the index
+label.example_filenames = Example filenames
+label.increment_index = Increment suffix indexes (like version files) - newest file has largest index.
+label.reverse_roll = Reverse and "roll" suffix indexes (like log files) - newest file is always index 1.
+label.keep_files = Keep Files
+label.keep_all_backup_files = Keep all backup files
+label.keep_only_this_number_of_backup_files = Keep only this number of most recent backup files
+label.old_backup_files = Old backup files:
+label.confirm_delete = Confirm deletions
+label.auto_delete = Automatically delete
+label.filename = filename
+label.braced_oldest = (oldest)
+label.braced_newest = (most recent)
label.configuration = Configuration
label.configure_feature_tooltip = Click to configure variable colour or filters
action.close_all = Cerrar todo
action.load_project = Cargar proyecto
action.save_project = Guardar proyecto
+action.save_project_as = Guardar proyecto como...
action.quit = Salir
action.expand_views = Expandir vistas
action.gather_views = Capturar vistas
label.most_polymer_residues = Más Residuos de Polímeros
label.cached_structures = Estructuras en Caché
label.free_text_search = Búsqueda de texto libre
+# dodgy tranlations by Ben and Google translate -- probably could do better
+label.backupfiles_confirm_delete = Confirmar borrar
+label.backupfiles_confirm_delete_old_files = ¿Borrar los siguientes archivos? (ver la pestaña 'Copias' de la ventana de Preferencias para más opciones)
+label.backupfiles_confirm_save_file = Confirmar guardar archivo
+label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Posiblemente algo está mal con los archivos de copia de seguridad. ¿Guardar el nuevo archivo?
+label.backups = Copias
+label.backup_files = Copias de seguridad
+label.enable_backupfiles = Habilitar copias de seguridad
+label.suffix_format = Formato de sufijo
+label.suffix_template = Plantilla de sufijo (usa %n para representar el índice)
+label.suffix_template_tooltip = Esto será reemplazado por el número de índice. El sufijo aparecerá antes de la extensión.
+label.index_digits = Número de dígitos a utilizar para el índice.
+label.example_filenames = Ejemplos de nombres de archivos
+label.increment_index = El archivo más nuevo tiene el índice más grande
+label.reverse_roll = El archivo más nuevo tiene índice 1
+label.keep_files = Manten los archivos
+label.keep_all_backup_files = Mantener todos los archivos de copia de seguridad
+label.keep_only_this_number_of_backup_files = Mantenga solo este número de archivos de copia de seguridad más recientes
+label.old_backup_files = Viejos archivos de copia de seguridad:
+label.confirm_delete = Confirmar eliminaciones
+label.auto_delete = Eliminar automáticamente
+label.filename = nombre_de_archivo
+label.braced_oldest = (mas antiguo)
+label.braced_newest = (mas nuevo)
label.configuration = Configuración
label.configure_feature_tooltip = Haga clic para configurar el color o los filtros
return def;
}
+ public static int getDefault(String property, int def)
+ {
+ String string = getProperty(property);
+ if (string != null)
+ {
+ try
+ {
+ def = Integer.parseInt(string);
+ } catch (NumberFormatException e)
+ {
+ System.out.println("Error parsing int property '" + property
+ + "' with value '" + string + "'");
+ }
+ }
+
+ return def;
+ }
+
/**
* These methods are used when checking if the saved preference is different
* to the default setting
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
+import jalview.io.BackupFiles;
import jalview.io.BioJsHTMLOutput;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
}
else
{
+ // create backupfiles object and get new temp filename destination
+ BackupFiles backupfiles = new BackupFiles(file);
+
try
{
- PrintWriter out = new PrintWriter(new FileWriter(file));
+ PrintWriter out = new PrintWriter(
+ new FileWriter(backupfiles.getTempFilePath()));
out.print(output);
out.close();
success = false;
ex.printStackTrace();
}
+
+ backupfiles.setWriteSuccess(success);
+ // do the backup file roll and rename the temp file to actual file
+ success = backupfiles.rollBackupsAndRenameTempFile();
+
}
}
import jalview.api.AlignmentViewPanel;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+import jalview.io.BackupFiles;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.FileFormatException;
@Override
public void saveState_actionPerformed()
{
- JalviewFileChooser chooser = new JalviewFileChooser("jvp",
- "Jalview Project");
+ saveState_actionPerformed(false);
+ }
- chooser.setFileView(new JalviewFileView());
- chooser.setDialogTitle(MessageManager.getString("label.save_state"));
+ public void saveState_actionPerformed(boolean saveAs)
+ {
+ java.io.File projectFile = getProjectFile();
+ // autoSave indicates we already have a file and don't need to ask
+ boolean autoSave = projectFile != null && !saveAs && BackupFiles.getEnabled();
- int value = chooser.showSaveDialog(this);
+ System.out.println("autoSave="+autoSave+", projectFile='"+projectFile+"', saveAs="+saveAs+", Backups "+(BackupFiles.getEnabled()?"enabled":"disabled"));
- if (value == JalviewFileChooser.APPROVE_OPTION)
+ boolean approveSave = false;
+ if (!autoSave)
{
- final Desktop me = this;
- final java.io.File choice = chooser.getSelectedFile();
- setProjectFile(choice);
+ JalviewFileChooser chooser = new JalviewFileChooser("jvp",
+ "Jalview Project");
+ chooser.setFileView(new JalviewFileView());
+ chooser.setDialogTitle(MessageManager.getString("label.save_state"));
+
+ int value = chooser.showSaveDialog(this);
+
+ if (value == JalviewFileChooser.APPROVE_OPTION)
+ {
+ projectFile = chooser.getSelectedFile();
+ setProjectFile(projectFile);
+ approveSave = true;
+ }
+ }
+
+ if (approveSave || autoSave) {
+ final Desktop me = this;
+ final java.io.File chosenFile = projectFile;
new Thread(new Runnable()
{
@Override
// TODO: refactor to Jalview desktop session controller action.
setProgressBar(MessageManager.formatMessage(
"label.saving_jalview_project", new Object[]
- { choice.getName() }), choice.hashCode());
+ { chosenFile.getName() }), chosenFile.hashCode());
jalview.bin.Cache.setProperty("LAST_DIRECTORY",
- choice.getParent());
+ chosenFile.getParent());
// TODO catch and handle errors for savestate
// TODO prevent user from messing with the Desktop whilst we're saving
try
{
- new Jalview2XML().saveState(choice);
+ BackupFiles backupfiles = new BackupFiles(chosenFile);
+
+ new Jalview2XML().saveState(backupfiles.getTempFile());
+
+ backupfiles.setWriteSuccess(true);
+ backupfiles.rollBackupsAndRenameTempFile();
} catch (OutOfMemoryError oom)
{
new OOMWarning(
- "Whilst saving current state to " + choice.getName(),
+ "Whilst saving current state to " + chosenFile.getName(),
oom);
} catch (Exception ex)
{
Cache.log.error(
- "Problems whilst trying to save to " + choice.getName(),
+ "Problems whilst trying to save to " + chosenFile.getName(),
ex);
JvOptionPane.showMessageDialog(me,
MessageManager.formatMessage(
"label.error_whilst_saving_current_state_to",
new Object[]
- { choice.getName() }),
+ { chosenFile.getName() }),
MessageManager.getString("label.couldnt_save_project"),
JvOptionPane.WARNING_MESSAGE);
}
- setProgressBar(null, choice.hashCode());
+ setProgressBar(null, chosenFile.hashCode());
}
}).start();
}
}
+ @Override
+ public void saveAsState_actionPerformed(ActionEvent e)
+ {
+ saveState_actionPerformed(true);
+ }
+
private void setProjectFile(File choice)
{
this.projectFile = choice;
--- /dev/null
+package jalview.gui;
+
+import java.awt.Font;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonGroup;
+import javax.swing.JRadioButton;
+
+public class JalviewBooleanRadioButtons extends AbstractButton
+{
+ private static final Font LABEL_FONT = JvSwingUtils.getLabelFont();
+
+ private ButtonGroup buttonGroup = new ButtonGroup();
+
+ private JRadioButton buttonTrue = new JRadioButton();
+
+ private JRadioButton buttonFalse = new JRadioButton();
+
+ public JalviewBooleanRadioButtons(boolean value, String trueLabel,
+ String falseLabel)
+ {
+ init();
+ this.setLabels(trueLabel, falseLabel);
+ }
+
+ public JalviewBooleanRadioButtons(boolean value)
+ {
+ init();
+ setSelected(value);
+ }
+
+ public JalviewBooleanRadioButtons()
+ {
+ init();
+ }
+
+ protected void init()
+ {
+ buttonTrue.setFont(LABEL_FONT);
+ buttonFalse.setFont(LABEL_FONT);
+ buttonGroup.add(buttonTrue);
+ buttonGroup.add(buttonFalse);
+ }
+
+ public void setLabels(String trueLabel, String falseLabel)
+ {
+ buttonTrue.setText(trueLabel);
+ buttonFalse.setText(falseLabel);
+ }
+
+ @Override
+ public void setSelected(boolean b)
+ {
+ buttonFalse.setSelected(!b);
+ // this should probably happen automatically, no harm in forcing the issue!
+ // setting them this way round so the last setSelected is on buttonTrue
+ buttonTrue.setSelected(b);
+ }
+
+ @Override
+ public boolean isSelected()
+ {
+ // unambiguous selection
+ return buttonTrue.isSelected() && !buttonFalse.isSelected();
+ }
+
+ @Override
+ public void setEnabled(boolean b)
+ {
+ buttonTrue.setEnabled(b);
+ buttonFalse.setEnabled(b);
+ }
+
+ @Override
+ public boolean isEnabled()
+ {
+ return buttonTrue.isEnabled() && buttonFalse.isEnabled();
+ }
+
+ public JRadioButton getTrueButton()
+ {
+ return buttonTrue;
+ }
+
+ public JRadioButton getFalseButton()
+ {
+ return buttonFalse;
+ }
+
+ @Override
+ public void addActionListener(ActionListener l)
+ {
+ buttonTrue.addActionListener(l);
+ buttonFalse.addActionListener(l);
+ }
+
+ public void addTrueActionListener(ActionListener l)
+ {
+ buttonTrue.addActionListener(l);
+ }
+
+ public void addFalseActionListener(ActionListener l)
+ {
+ buttonFalse.addActionListener(l);
+ }
+}
import jalview.bin.Cache;
import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.BackupFiles;
import jalview.io.FileFormatI;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
annotations_actionPerformed(null); // update the display of the annotation
// settings
+
+
+ /*
+ * Set Backups tab defaults
+ */
+ enableBackupFiles
+ .setSelected(Cache.getDefault(BackupFiles.ENABLED, true));
+ suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX,
+ "-v" + BackupFiles.NUM_PLACEHOLDER));
+ suffixDigitsSpinner
+ .setValue(Cache.getDefault(BackupFiles.SUFFIX_DIGITS, 3));
+ suffixReverse.setSelected(
+ Cache.getDefault(BackupFiles.REVERSE_ORDER, false));
+ backupfilesKeepAll
+ .setSelected(Cache.getDefault(BackupFiles.NO_MAX, false));
+ backupfilesRollMaxSpinner
+ .setValue(Cache.getDefault(BackupFiles.ROLL_MAX, 4));
+ backupfilesConfirmDelete.setSelected(
+ Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true));
+ backupsOptionsSetEnabled(enableBackupFiles.isSelected());
+ updateBackupFilesExampleLabel();
+ /*
+ suffixPanel.setPreferredSize(
+ new Dimension(width, suffixPanel.getHeight()));
+ keepfilesPanel.setPreferredSize(
+ new Dimension(width, keepfilesPanel.getHeight()));
+ exampleFilesPanel.setPreferredSize(
+ new Dimension(width, exampleFilesPanel.getHeight()));
+ */
+
}
/**
Boolean.toString(padGaps.isSelected()));
wsPrefs.updateAndRefreshWsMenuConfig(false);
+
+ /*
+ * Save Backups settings
+ */
+ Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
+ Boolean.toString(backupfilesConfirmDelete.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+ Boolean.toString(enableBackupFiles.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
+ Boolean.toString(backupfilesKeepAll.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
+ Boolean.toString(suffixReverse.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX,
+ suffixTemplate.getText());
+ Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
+ Integer.toString(getSpinnerInt(backupfilesRollMaxSpinner, 4)));
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX_DIGITS,
+ Integer.toString(getSpinnerInt(suffixDigitsSpinner, 3)));
+
Cache.saveProperties();
Desktop.instance.doConfigureStructurePrefs();
try
--- /dev/null
+package jalview.io;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+
+public class BackupFilenameFilter implements FilenameFilter
+{
+
+ public String base;
+
+ public String template;
+
+ public int digits;
+
+ public String extension;
+
+ public BackupFilenameFilter(String base, String template, int digits,
+ String extension)
+ {
+ this.base = base;
+ this.template = template;
+ this.digits = digits;
+ this.extension = extension;
+ }
+
+ @Override
+ public boolean accept(File dir, String filename)
+ {
+ boolean ret = false;
+ try
+ {
+ File file = new File(
+ dir.getCanonicalPath() + File.separatorChar + filename);
+ if (file.isDirectory())
+ {
+ // backup files aren't dirs!
+ return false;
+ }
+ } catch (IOException e)
+ {
+ System.out.println("IOException when checking file '" + filename
+ + "' is a backupfile");
+ }
+
+ BackupFilenameParts bffp = new BackupFilenameParts(filename, base,
+ template, digits, extension);
+ ret = bffp.isBackupFile();
+ return ret;
+ }
+
+ public static String getBackupFilename(int index, String base,
+ String template, int digits, String extension)
+ {
+ String numString = String.format("%0" + digits + "d", index);
+ String backupSuffix = template.replaceAll(BackupFiles.NUM_PLACEHOLDER,
+ numString);
+ String backupfilename = base + backupSuffix + extension;
+ return backupfilename;
+ }
+
+}
+
--- /dev/null
+package jalview.io;
+
+import java.io.File;
+
+public class BackupFilenameParts
+{
+ String base;
+
+ String templateStart;
+
+ int num;
+
+ int digits;
+
+ String templateEnd;
+
+ String extension;
+
+ boolean isBackupFile;
+
+ public BackupFilenameParts(File file, String base, String template, int digits,
+ String extension)
+ {
+ this(file.getName(), base, template, digits, extension);
+ }
+
+ public BackupFilenameParts(String filename, String base, String template,
+ int digits, String extension)
+ {
+ this.isBackupFile = false;
+
+ // calculate minimum length of a backup filename
+ int minlength = base.length() + template.length()
+ - BackupFiles.NUM_PLACEHOLDER.length() + digits
+ + extension.length();
+
+ if (!(filename.startsWith(base) && filename.endsWith(extension)
+ && filename.length() >= minlength))
+ {
+ // non-starter
+ return;
+ }
+
+ int numcharstart = template.indexOf(BackupFiles.NUM_PLACEHOLDER);
+ String templateStart = template;
+ String templateEnd = "";
+ if (numcharstart > -1)
+ {
+ templateStart = template.substring(0, numcharstart);
+ templateEnd = template.substring(
+ numcharstart + BackupFiles.NUM_PLACEHOLDER.length());
+ }
+
+ int startLength = base.length() + templateStart.length();
+ int endLength = templateEnd.length() + extension.length();
+ String numString = filename.substring(startLength,
+ filename.length() - endLength);
+
+ if (filename.length() >= startLength + digits + endLength
+ && filename.startsWith(base + templateStart)
+ && filename.endsWith(templateEnd + extension)
+ && numString.matches("[0-9]+"))
+ {
+ this.base = base;
+ this.templateStart = templateStart;
+ this.num = Integer.parseInt(numString);
+ this.digits = digits;
+ this.templateStart = templateStart;
+ this.templateEnd = templateEnd;
+ this.isBackupFile = true;
+ }
+
+ }
+
+ public boolean isBackupFile()
+ {
+ return this.isBackupFile;
+ }
+
+ public int indexNum()
+ {
+ return this.num;
+ }
+}
--- /dev/null
+package jalview.io;
+
+import jalview.bin.Cache;
+import jalview.gui.Desktop;
+import jalview.gui.JvOptionPane;
+import jalview.util.MessageManager;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.TreeMap;
+
+/*
+ * BackupFiles used for manipulating (naming rolling/deleting) backup/version files when an alignment or project file is saved.
+ * User configurable options are:
+ * BACKUPFILES_ENABLED - boolean flag as to whether to use this mechanism or act as before, including overwriting files as saved.
+ * BACKUPFILES_SUFFIX - a template to insert just before the file extension. Use '%n' to be replaced by a 0-led SUFFIX_DIGITS long integer.
+ * BACKUPFILES_NO_MAX - flag to turn off setting a maximum number of backup files to keep.
+ * BACKUPFILES_ROLL_MAX - the maximum number of backupfiles to keep for any one alignment or project file.
+ * BACKUPFILES_SUFFIX_DIGITS - the number of digits to insert replace %n with (e.g. BACKUPFILES_SUFFIX_DIGITS = 3 would make "001", "002", etc)
+ * BACKUPFILES_REVERSE_ORDER - if true then "logfile" style numbering and file rolling will occur. If false then ever-increasing version numbering will occur, but old files will still be deleted if there are more than ROLL_MAX backup files.
+ * BACKUPFILES_CONFIRM_DELETE_OLD - if true then prompt/confirm with the user when deleting older backup/version files.
+ */
+
+public class BackupFiles
+{
+
+ // labels for saved params in Cache and .jalview_properties
+ private static final String NS = "BACKUPFILES";
+
+ public static final String ENABLED = NS + "_ENABLED";
+
+ public static final String SUFFIX = NS + "_SUFFIX";
+
+ public static final String NO_MAX = NS + "_NO_MAX";
+
+ public static final String ROLL_MAX = NS + "_ROLL_MAX";
+
+ public static final String SUFFIX_DIGITS = NS + "_SUFFIX_DIGITS";
+
+ public static final String NUM_PLACEHOLDER = "%n";
+
+ public static final String REVERSE_ORDER = NS + "_REVERSE_ORDER";
+
+ public static final String CONFIRM_DELETE_OLD = NS + "_CONFIRM_DELETE_OLD";
+
+ private static final String DEFAULT_TEMP_FILE = "jalview_temp_file_" + NS;
+
+ // file - File object to be backed up and then updated (written over)
+ private File file;
+
+ // enabled - default flag as to whether to do the backup file roll (if not
+ // defined in preferences)
+ private static boolean enabled;
+
+ // confirmDelete - default flag as to whether to confirm with the user before
+ // deleting old backup/version files
+ private static boolean confirmDelete;
+
+ // defaultSuffix - default template to use to append to basename of file
+ private String suffix;
+
+ // noMax - flag to turn off a maximum number of files
+ private boolean noMax;
+
+ // defaultMax - default max number of backup files
+ private int max;
+
+ // defaultDigits - number of zero-led digits to use in the filename
+ private int digits;
+
+ // reverseOrder - set to true to make newest (latest) files lowest number
+ // (like rolled log files)
+ private boolean reverseOrder;
+
+ // temp saved file to become new saved file
+ private File tempFile;
+
+ // flag set to see if file save to temp file was successful
+ private boolean tempFileWriteSuccess;
+
+ public BackupFiles(String filename)
+ {
+ this(new File(filename));
+ }
+
+ // first time defaults for SUFFIX, NO_MAX, ROLL_MAX, SUFFIX_DIGITS and
+ // REVERSE_ORDER
+ public BackupFiles(File file)
+ {
+ this(file, "-v" + NUM_PLACEHOLDER, false, 4, 3, false);
+ }
+
+ public BackupFiles(File file,
+ String defaultSuffix, boolean defaultNoMax, int defaultMax,
+ int defaultDigits,
+ boolean defaultReverseOrder)
+ {
+ classInit();
+ this.file = file;
+ this.suffix = Cache.getDefault(SUFFIX, defaultSuffix);
+ this.noMax = Cache.getDefault(NO_MAX, defaultNoMax);
+ this.max = Cache.getDefault(ROLL_MAX, defaultMax);
+ this.digits = Cache.getDefault(SUFFIX_DIGITS, defaultDigits);
+ this.reverseOrder = Cache.getDefault(REVERSE_ORDER,
+ defaultReverseOrder);
+
+ // create a temp file to save new data in
+ File temp = null;
+ try
+ {
+ if (file != null)
+ {
+ String tempfilename = file.getName();
+ File tempdir = file.getParentFile();
+ temp = File.createTempFile(tempfilename, ".tmp", tempdir);
+ }
+ else
+ {
+ temp = File.createTempFile(DEFAULT_TEMP_FILE, ".tmp");
+ }
+ } catch (IOException e)
+ {
+ System.out.println(
+ "Could not create temp file to save into (IOException)");
+ } catch (Exception e)
+ {
+ System.out.println("Exception ctreating temp file for saving");
+ }
+ this.setTempFile(temp);
+ }
+
+ public static void classInit()
+ {
+ setEnabled(Cache.getDefault(ENABLED, true));
+ setConfirmDelete(Cache.getDefault(CONFIRM_DELETE_OLD, true));
+ }
+
+ public static void setEnabled(boolean flag)
+ {
+ enabled = flag;
+ }
+
+ public static boolean getEnabled()
+ {
+ classInit();
+ return enabled;
+ }
+
+ public static void setConfirmDelete(boolean flag)
+ {
+ confirmDelete = flag;
+ }
+
+ public static boolean getConfirmDelete()
+ {
+ classInit();
+ return confirmDelete;
+ }
+
+ // set, get and rename temp file into place
+ public void setTempFile(File temp)
+ {
+ this.tempFile = temp;
+ }
+
+ public File getTempFile()
+ {
+ return tempFile;
+ }
+
+ public String getTempFilePath()
+ {
+ String path = null;
+ try
+ {
+ path = this.getTempFile().getCanonicalPath();
+ } catch (IOException e)
+ {
+ System.out.println(
+ "IOException when getting Canonical Path of temp file '"
+ + this.getTempFile().getName() + "'");
+ }
+ return path;
+ }
+
+ public boolean setWriteSuccess(boolean flag)
+ {
+ boolean old = this.tempFileWriteSuccess;
+ this.tempFileWriteSuccess = flag;
+ return old;
+ }
+
+ public boolean getWriteSuccess()
+ {
+ return this.tempFileWriteSuccess;
+ }
+
+ public boolean renameTempFile()
+ {
+ return tempFile.renameTo(file);
+ }
+
+
+ // roll the backupfiles
+ public boolean rollBackupFiles()
+ {
+
+ // file doesn't yet exist or backups are not enabled
+ if ((!file.exists()) || (!enabled) || (max < 0))
+ {
+ // nothing to do
+ return true;
+ }
+
+ // split filename up to insert suffix template in the right place. template
+ // and backupMax can be set in .jalview_properties
+ String dir = "";
+ File dirFile;
+ try
+ {
+ dirFile = file.getParentFile();
+ dir = dirFile.getCanonicalPath();
+ } catch (Exception e)
+ {
+ System.out.println(
+ "Could not get canonical path for file '" + file + "'");
+ return false;
+ }
+ String filename = file.getName();
+ String basename = filename;
+ String extension = "";
+ int dotcharpos = filename.lastIndexOf('.');
+ // don't split filenames with the last '.' at the very beginning or
+ // very end of the filename
+ if ((dotcharpos > 0) && (dotcharpos < filename.length() - 1))
+ {
+ basename = filename.substring(0, dotcharpos);
+ extension = filename.substring(dotcharpos); // NOTE this includes the '.'
+ }
+
+ boolean ret = true;
+ // Create/move backups up one
+
+ File[] oldFilesToDelete = null;
+
+ // find existing backup files
+ BackupFilenameFilter bff = new BackupFilenameFilter(basename, suffix,
+ digits,
+ extension);
+ File[] backupFiles = dirFile.listFiles(bff);
+ int nextIndexNum = 0;
+ String confirmDeleteExtraInfo = null;
+
+ if (backupFiles.length == 0)
+ {
+ // No other backup files. Just need to move existing file to backupfile_1
+ nextIndexNum = 1;
+ }
+ else
+ {
+ TreeMap<Integer, File> bfTreeMap = sortBackupFilesAsTreeMap(backupFiles, basename, extension);
+
+ if (reverseOrder)
+ {
+ // backup style numbering
+
+ File lastfile = null;
+ int tempMax = noMax ? -1 : max;
+ // noMax == true means no limits
+ // look for first "gap" in backupFiles
+ // if tempMax is -1 at this stage just keep going until there's a gap,
+ // then hopefully tempMax gets set to the right index (a positive
+ // integer so the loop breaks)...
+ // why do I feel a little uneasy about this loop?..
+ for (int i = 1; tempMax < 0 || i <= max; i++)
+ {
+ if (!bfTreeMap.containsKey(i)) // first index without existent
+ // backupfile
+ {
+ tempMax = i;
+ }
+ }
+
+ // for (int m = 0; m < tempMax; m++)
+ for (int n = tempMax; n > 0; n--)
+ {
+ // int n = tempMax - m;
+ String backupfilename = dir + File.separatorChar
+ + BackupFilenameFilter.getBackupFilename(n, basename,
+ suffix, digits, extension);
+ File backupfile_n = new File(backupfilename);
+
+ if (!backupfile_n.exists())
+ {
+ lastfile = backupfile_n;
+ continue;
+ }
+
+ // if (m == 0 && backupfile_n.exists())
+ if ((!noMax) && n == tempMax && backupfile_n.exists())
+ {
+ // move the largest (max) rolled file to a temp file and add to the delete list
+ try
+ {
+ File temp = File.createTempFile(backupfilename, ".tmp",
+ dirFile);
+ backupfile_n.renameTo(temp);
+
+ oldFilesToDelete = new File[] { temp };
+ confirmDeleteExtraInfo = "(was " + backupfile_n.getName()
+ + ")";
+ } catch (IOException e)
+ {
+ System.out.println(
+ "IOException when creating temporary file for backupfilename");
+ }
+ }
+ else
+ {
+ // Just In Case
+ if (lastfile != null)
+ {
+ ret = ret && backupfile_n.renameTo(lastfile);
+ }
+ }
+
+ lastfile = backupfile_n;
+ }
+
+ // index to use for the latest backup
+ nextIndexNum = 1;
+ }
+ else
+ {
+ // version style numbering (with earliest file deletion if max files
+ // reached)
+
+
+ bfTreeMap.values().toArray(backupFiles);
+
+ // noMax == true means keep all backup files
+ if ((!noMax) && bfTreeMap.size() >= max)
+ {
+ // need to delete some files to keep number of backups to designated
+ // max
+ int numToDelete = bfTreeMap.size() - max + 1;
+ oldFilesToDelete = Arrays.copyOfRange(backupFiles, 0,
+ numToDelete);
+
+ }
+
+ nextIndexNum = bfTreeMap.lastKey() + 1;
+
+ }
+ }
+
+ deleteOldFiles(oldFilesToDelete, confirmDeleteExtraInfo);
+
+ // Let's make the new backup file!! yay, got there at last!
+ String latestBackupFilename = dir + File.separatorChar
+ + BackupFilenameFilter.getBackupFilename(nextIndexNum, basename,
+ suffix, digits, extension);
+ File latestBackupFile = new File(latestBackupFilename);
+ ret = ret && file.renameTo(latestBackupFile);
+
+ return ret;
+ }
+
+ private void deleteOldFiles(File[] oldFilesToDelete, String confirmDeleteExtraInfo) {
+ if (oldFilesToDelete != null && oldFilesToDelete.length > 0)
+ {
+ // delete old backup/version files
+
+ boolean delete = false;
+ if (confirmDelete)
+ {
+ // Object[] confirmMessageArray = {};
+ StringBuilder confirmMessage = new StringBuilder();
+ confirmMessage.append(MessageManager
+ .getString("label.backupfiles_confirm_delete_old_files"));
+ for (File f : oldFilesToDelete)
+ {
+ confirmMessage.append("\n");
+ confirmMessage.append(f.getName());
+ }
+ if (confirmDeleteExtraInfo != null
+ && confirmDeleteExtraInfo.length() > 0)
+ {
+ confirmMessage.append("\n");
+ confirmMessage.append(confirmDeleteExtraInfo);
+ }
+ int confirm = JvOptionPane.showConfirmDialog(Desktop.desktop,
+ confirmMessage.toString(),
+ MessageManager
+ .getString("label.backupfiles_confirm_delete"),
+ JvOptionPane.YES_NO_OPTION, JvOptionPane.WARNING_MESSAGE);
+
+ delete = (confirm == JvOptionPane.YES_OPTION);
+ }
+ else
+ {
+ delete = true;
+ }
+
+ if (delete)
+ {
+ for (int i = 0; i < oldFilesToDelete.length; i++)
+ {
+ File fileToDelete = oldFilesToDelete[i];
+ fileToDelete.delete();
+ // System.out.println("DELETING '" + fileToDelete.getName() +
+ // "'");
+ }
+ }
+
+ }
+ }
+
+ private TreeMap sortBackupFilesAsTreeMap(File[] backupFiles, String basename, String extension) {
+ // sort the backup files (based on integer found in the suffix) using a
+ // precomputed Hashmap for speed
+ Map<Integer, File> bfHashMap = new HashMap<>();
+ for (int i = 0; i < backupFiles.length; i++)
+ {
+ File f = backupFiles[i];
+ BackupFilenameParts bfp = new BackupFilenameParts(f, basename, suffix, digits, extension);
+ bfHashMap.put(bfp.indexNum(), f);
+ }
+ TreeMap<Integer, File> bfTreeMap = new TreeMap<>();
+ bfTreeMap.putAll(bfHashMap);
+ return bfTreeMap;
+ }
+
+ public boolean rollBackupsAndRenameTempFile()
+ {
+ boolean write = this.getWriteSuccess();
+
+ boolean roll = false;
+ if (write) {
+ roll = this.rollBackupFiles();
+ } else {
+ return false;
+ }
+
+ /*
+ * Not sure that this confirmation is desirable. By this stage the new file is
+ * already written successfully, but something (e.g. disk full) has happened while
+ * trying to roll the backup files, and most likely the filename needed will already
+ * be vacant so renaming the temp file is nearly always correct!
+ */
+ if (!roll)
+ {
+ int confirm = JvOptionPane.showConfirmDialog(Desktop.desktop,
+ MessageManager.getString(
+ "label.backupfiles_confirm_save_file_backupfiles_roll_wrong"),
+ MessageManager.getString("label.backupfiles_confirm_save_file"),
+ JvOptionPane.YES_NO_OPTION, JvOptionPane.WARNING_MESSAGE);
+
+ if (confirm == JvOptionPane.YES_OPTION)
+ {
+ roll = true;
+ }
+ }
+
+ boolean rename = false;
+ if (roll)
+ {
+ rename = this.renameTempFile();
+ }
+
+ return rename;
+ }
+
+ public static TreeMap<Integer, File> getBackupFilesAsTreeMap(
+ String fileName,
+ String suffix, int digits)
+ {
+ File[] backupFiles = null;
+
+ File file = new File(fileName);
+
+ String dir = "";
+ File dirFile;
+ try
+ {
+ dirFile = file.getParentFile();
+ dir = dirFile.getCanonicalPath();
+ } catch (Exception e)
+ {
+ System.out.println(
+ "Could not get canonical path for file '" + file + "'");
+ return new TreeMap<>();
+ }
+
+ String filename = file.getName();
+ String basename = filename;
+ String extension = "";
+ int dotcharpos = filename.lastIndexOf('.');
+ // don't split of filenames with the last '.' at the very beginning or
+ // very end of the filename
+ if ((dotcharpos > 0) && (dotcharpos < filename.length() - 1))
+ {
+ basename = filename.substring(0, dotcharpos);
+ extension = filename.substring(dotcharpos); // NOTE this includes the '.'
+ }
+
+ // find existing backup files
+ BackupFilenameFilter bff = new BackupFilenameFilter(basename, suffix, digits, extension);
+ backupFiles = dirFile.listFiles(bff); // is clone needed?
+
+ // sort the backup files (based on integer found in the suffix) using a
+ // precomputed Hashmap for speed
+ Map<Integer, File> bfHashMap = new HashMap<>();
+ for (int i = 0; i < backupFiles.length; i++)
+ {
+ File f = backupFiles[i];
+ BackupFilenameParts bfp = new BackupFilenameParts(f, basename, suffix,
+ digits, extension);
+ bfHashMap.put(bfp.indexNum(), f);
+ }
+ TreeMap<Integer, File> bfTreeMap = new TreeMap<>();
+ bfTreeMap.putAll(bfHashMap);
+
+ return bfTreeMap;
+ }
+
+
+}
+
setSelectedFile(ourselectedFile);
}
}
+
// TODO: ENSURE THAT FILES SAVED WITH A ':' IN THE NAME ARE REFUSED AND THE
- // USER PROMPTED FOR A NEW FILENAME
+ // USER PROMPTED FOR A NEW FILENAME.
+ // DO NOT need to confirm file overwrite if using backup files (the files
+ // aren't being overwritten!)
if ((ret == JalviewFileChooser.APPROVE_OPTION)
- && ourselectedFile.exists())
+ && ourselectedFile.exists() && (!BackupFiles.getEnabled()))
{
int confirm = JvOptionPane.showConfirmDialog(parent,
MessageManager.getString("label.overwrite_existing_file"),
{
ret = JalviewFileChooser.CANCEL_OPTION;
}
+
}
return ret;
JMenuItem saveState = new JMenuItem();
+ JMenuItem saveAsState = new JMenuItem();
+
JMenuItem loadState = new JMenuItem();
JMenu inputMenu = new JMenu();
saveState_actionPerformed();
}
});
+ saveAsState.setText(MessageManager.getString("action.save_project_as"));
+ saveAsState.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ saveAsState_actionPerformed(e);
+ }
+ });
loadState.setText(MessageManager.getString("action.load_project"));
loadState.addActionListener(new ActionListener()
{
FileMenu.add(inputSequence);
FileMenu.addSeparator();
FileMenu.add(saveState);
+ FileMenu.add(saveAsState);
FileMenu.add(loadState);
FileMenu.addSeparator();
FileMenu.add(quit);
{
}
+ public void saveAsState_actionPerformed(ActionEvent e)
+ {
+ }
+
+ /**
+ * DOCUMENT ME!
+ *
+ * @param e
+ * DOCUMENT ME!
+ */
public void loadState_actionPerformed()
{
}
import jalview.fts.core.FTSDataColumnPreferences;
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
import jalview.fts.service.pdb.PDBFTSRestClient;
+import jalview.gui.JalviewBooleanRadioButtons;
import jalview.gui.JvSwingUtils;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.BackupFilenameFilter;
import jalview.util.MessageManager;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
+import javax.swing.JSpinner;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
+import javax.swing.SpinnerModel;
+import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
*/
protected JPanel wsTab = new JPanel();
+ /*
+ * Backups tab components
+ * a lot of these are member variables instead of local variables only so that they
+ * can be enabled/disabled easily in one go
+ */
+
+ protected JCheckBox enableBackupFiles = new JCheckBox();
+
+ protected JPanel suffixPanel = new JPanel();
+
+ protected JPanel keepfilesPanel = new JPanel();
+
+ protected JPanel exampleFilesPanel = new JPanel();
+
+ protected JTextField suffixTemplate = new JTextField(null, 8);
+
+ protected JLabel suffixTemplateLabel = new JLabel();
+
+ protected JLabel suffixDigitsLabel = new JLabel();
+
+ protected JSpinner suffixDigitsSpinner = new JSpinner();
+
+ protected JalviewBooleanRadioButtons suffixReverse = new JalviewBooleanRadioButtons();
+
+ protected JalviewBooleanRadioButtons backupfilesKeepAll = new JalviewBooleanRadioButtons();
+
+ protected JSpinner backupfilesRollMaxSpinner = new JSpinner();
+
+ protected JLabel oldBackupFilesLabel = new JLabel();
+
+ protected JalviewBooleanRadioButtons backupfilesConfirmDelete = new JalviewBooleanRadioButtons();
+
+ protected JTextArea backupfilesExampleLabel = new JTextArea();
+
/**
* Creates a new GPreferences object.
*/
tabbedPane.add(initConnectionsTab(),
MessageManager.getString("label.connections"));
+ tabbedPane.add(initBackupsTab(),
+ MessageManager.getString("label.backups"));
+
tabbedPane.add(initLinksTab(),
MessageManager.getString("label.urllinks"));
embbedBioJSON.setText(MessageManager.getString("label.embbed_biojson"));
embbedBioJSON.setBounds(new Rectangle(228, 200, 250, 23));
+
+ TitledBorder backupFilesBorder = new TitledBorder(
+ MessageManager
+ .getString("label.backup_files"));
+
+
jPanel11.add(jLabel1);
jPanel11.add(blcjv);
jPanel11.add(clustaljv);
return visualTab;
}
+ /**
+ * Initialises the Backups tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initBackupsTab()
+ {
+ JPanel backupsTab = new JPanel();
+ // backupsTab.setBorder(new TitledBorder(MessageManager
+ // .getString("label.backup_files")));
+ backupsTab.setLayout(new GridBagLayout());
+
+ enableBackupFiles.setFont(LABEL_FONT);
+ enableBackupFiles.setText(
+ MessageManager.getString("label.enable_backupfiles"));
+ enableBackupFiles.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean selected = enableBackupFiles.isSelected();
+ // enable other options only when the first is checked
+ backupsOptionsSetEnabled(selected);
+ }
+ });
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 1.0;
+ gbc.weighty = 0.0;
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.fill = GridBagConstraints.NONE;
+
+ // enable checkbox 1 row
+ gbc.gridwidth = 1;
+ gbc.gridy = 0;
+ backupsTab.add(enableBackupFiles, gbc);
+
+ initBackupsTabSuffixPanel();
+ initBackupsTabKeepFilesPanel();
+ initBackupsTabFilenameExamplesPanel();
+
+ /*
+ // set widths of the panels to the max one
+ int maxw = suffixPanel.getWidth();
+ if (maxw < keepfilesPanel.getWidth())
+ {
+ maxw = keepfilesPanel.getWidth();
+ }
+ if (maxw < exampleFilesPanel.getWidth())
+ {
+ maxw = exampleFilesPanel.getWidth();
+ }
+ suffixPanel.setSize(suffixPanel.getHeight(), maxw);
+ keepfilesPanel.setSize(keepfilesPanel.getHeight(), maxw);
+ exampleFilesPanel.setSize(exampleFilesPanel.getHeight(), maxw);
+ */
+
+ // whole suffix panel next row
+ gbc.gridy = 1;
+ backupsTab.add(suffixPanel, gbc);
+
+ // keep files panel
+ gbc.gridy = 2;
+ backupsTab.add(keepfilesPanel, gbc);
+
+ // whole examples panel next row
+ gbc.gridy = 3;
+ backupsTab.add(exampleFilesPanel, gbc);
+
+ // fill empty space
+ gbc.gridy = 4;
+ gbc.weighty = 1.0;
+ backupsTab.add(new JPanel(), gbc);
+
+ backupsOptionsSetEnabled(enableBackupFiles.isSelected());
+ return backupsTab;
+ }
+
+
+ public JPanel initBackupsTabSuffixPanel()
+ {
+ suffixPanel.setBorder(new TitledBorder(
+ MessageManager.getString("label.suffix_format")));
+ suffixPanel.setLayout(new GridBagLayout());
+
+ suffixTemplateLabel
+ .setText(MessageManager.getString("label.suffix_template"));
+ suffixTemplateLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ suffixTemplateLabel.setFont(LABEL_FONT);
+
+ final String tooltip = JvSwingUtils.wrapTooltip(true, MessageManager
+ .getString("label.suffix_template_tooltip"));
+ suffixTemplate.setToolTipText(tooltip);
+ suffixTemplate.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+
+ });
+ KeyListener kl = new KeyListener()
+ {
+ @Override
+ public void keyReleased(KeyEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e)
+ {
+ }
+
+ // disable use of ':'
+ @Override
+ public void keyTyped(KeyEvent e)
+ {
+ char c = e.getKeyChar();
+ if (c == ':')
+ {
+ // don't process ':'
+ e.consume();
+ }
+ }
+
+ };
+ suffixTemplate.addKeyListener(kl);
+
+ // digits spinner
+ suffixDigitsLabel
+ .setText(MessageManager.getString("label.index_digits"));
+ suffixDigitsLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ suffixDigitsLabel.setFont(LABEL_FONT);
+ int defaultmin = 1;
+ int defaultmax = 6;
+ ChangeListener c = new ChangeListener()
+ {
+ @Override
+ public void stateChanged(ChangeEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+
+ };
+ setIntegerSpinner(suffixDigitsSpinner, defaultmin, defaultmax, 3, c);
+
+ suffixReverse.setLabels(
+ MessageManager.getString("label.reverse_roll"),
+ MessageManager.getString("label.increment_index"));
+ suffixReverse.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+ });
+
+ GridBagConstraints sgbc = new GridBagConstraints();
+
+ // first row (template text box)
+ sgbc.anchor = GridBagConstraints.WEST;
+ sgbc.gridx = 0;
+ sgbc.gridy = 0;
+ sgbc.gridwidth = 1;
+ sgbc.gridheight = 1;
+ sgbc.weightx = 1.0;
+ sgbc.weighty = 0.0;
+ sgbc.fill = GridBagConstraints.NONE;
+ suffixPanel.add(suffixTemplateLabel,sgbc);
+
+ sgbc.gridx = 1;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixTemplate, sgbc);
+
+ // second row (number of digits spinner)
+ sgbc.gridy = 1;
+
+ sgbc.gridx = 0;
+ sgbc.fill = GridBagConstraints.NONE;
+ suffixPanel.add(suffixDigitsLabel, sgbc);
+
+ sgbc.gridx = 1;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixDigitsSpinner, sgbc);
+
+ // third row (forward order radio selection)
+ sgbc.gridx = 0;
+ sgbc.gridy = 2;
+ sgbc.gridwidth = GridBagConstraints.REMAINDER;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixReverse.getFalseButton(), sgbc);
+
+ // fourth row (reverse order radio selection)
+ sgbc.gridy = 3;
+ suffixPanel.add(suffixReverse.getTrueButton(), sgbc);
+ return suffixPanel;
+ }
+
+ private JPanel initBackupsTabKeepFilesPanel()
+ {
+ keepfilesPanel.setBorder(
+ new TitledBorder(MessageManager.getString("label.keep_files")));
+ keepfilesPanel.setLayout(new GridBagLayout());
+
+ backupfilesKeepAll.setLabels(
+ MessageManager.getString("label.keep_all_backup_files"),
+ MessageManager.getString(
+ "label.keep_only_this_number_of_backup_files"));
+ backupfilesKeepAll.addTrueActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+ });
+ backupfilesKeepAll.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean selected = backupfilesKeepAll.isSelected();
+ keepRollMaxOptionsEnabled(!selected);
+ updateBackupFilesExampleLabel();
+ }
+ });
+
+ ChangeListener c = new ChangeListener()
+ {
+ @Override
+ public void stateChanged(ChangeEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ }
+
+ };
+ setIntegerSpinner(backupfilesRollMaxSpinner, 1, 999, 4, true, c);
+
+ backupfilesConfirmDelete.setLabels(
+ MessageManager.getString("label.confirm_delete"),
+ MessageManager.getString("label.auto_delete"));
+ // update the enabled section
+ keepRollMaxOptionsEnabled(!backupfilesKeepAll.isSelected());
+
+ GridBagConstraints kgbc = new GridBagConstraints();
+
+ // first row (template text box)
+ kgbc.anchor = GridBagConstraints.WEST;
+ kgbc.gridx = 0;
+ kgbc.gridy = 0;
+ kgbc.gridwidth = GridBagConstraints.REMAINDER;
+ kgbc.gridheight = 1;
+ kgbc.weightx = 1.0;
+ kgbc.weighty = 0.0;
+ kgbc.fill = GridBagConstraints.HORIZONTAL;
+ keepfilesPanel.add(backupfilesKeepAll.getTrueButton(), kgbc);
+
+ // second row
+ kgbc.gridy = 1;
+
+ kgbc.gridx = 0;
+ kgbc.gridwidth = GridBagConstraints.RELATIVE;
+ keepfilesPanel.add(backupfilesKeepAll.getFalseButton(), kgbc);
+
+ kgbc.gridx = 1;
+ kgbc.gridwidth = GridBagConstraints.REMAINDER;
+ keepfilesPanel.add(backupfilesRollMaxSpinner, kgbc);
+
+ // third row (indented)
+ kgbc.gridy = 2;
+ kgbc.insets = new Insets(0, 20, 0, 0);
+
+ kgbc.gridx = 0;
+ kgbc.gridwidth = GridBagConstraints.REMAINDER;
+ kgbc.fill = GridBagConstraints.HORIZONTAL;
+ kgbc.weightx = 1.0;
+ /*
+ keepfilesPanel.add(backupfilesConfirmDelete.getTrueButton(), kgbc);
+
+ // fourth row (indented)
+ kgbc.gridy = 3;
+ keepfilesPanel.add(backupfilesConfirmDelete.getFalseButton(), kgbc);
+ */
+
+ JPanel jp = new JPanel();
+ jp.setLayout(new FlowLayout());
+ oldBackupFilesLabel
+ .setText(MessageManager.getString("label.old_backup_files"));
+ oldBackupFilesLabel.setFont(LABEL_FONT);
+ oldBackupFilesLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ jp.add(oldBackupFilesLabel);
+ jp.add(backupfilesConfirmDelete.getTrueButton());
+ jp.add(backupfilesConfirmDelete.getFalseButton());
+ keepfilesPanel.add(jp, kgbc);
+
+ return keepfilesPanel;
+ }
+
+ private JPanel initBackupsTabFilenameExamplesPanel()
+ {
+ exampleFilesPanel.setBorder(new TitledBorder(
+ MessageManager.getString("label.example_filenames")));
+ exampleFilesPanel.setLayout(new GridBagLayout());
+
+ backupfilesExampleLabel.setEditable(false);
+ backupfilesExampleLabel.setPreferredSize(new Dimension(400, 85));
+ backupfilesExampleLabel.setAlignmentX(LEFT_ALIGNMENT);
+ backupfilesExampleLabel.setAlignmentY(TOP_ALIGNMENT);
+
+ backupfilesExampleLabel.setFont(LABEL_FONT_ITALIC);
+ backupfilesExampleLabel
+ .setBackground(exampleFilesPanel.getBackground());
+
+ updateBackupFilesExampleLabel();
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.anchor = GridBagConstraints.WEST;
+ gbc.fill = GridBagConstraints.NONE;
+
+ gbc.gridy = 0;
+ exampleFilesPanel.add(backupfilesExampleLabel, gbc);
+ return exampleFilesPanel;
+ }
+
+ protected void updateBackupFilesExampleLabel()
+ {
+ int exampleindex = 12;
+ String base = MessageManager.getString("label.filename");
+ if (base == null || base.length() > 0)
+ {
+ base = "filename";
+ }
+ String extension = ".fa";
+
+ String suffix = suffixTemplate.getText();
+ int digits = 3;
+ try {
+ suffixDigitsSpinner.commitEdit();
+ digits = (Integer) suffixDigitsSpinner.getValue();
+ digits = digits < 1 ? 1 : digits;
+ } catch (Exception e)
+ {
+ System.out.println("Failed casting (Integer) suffixTemplateSpinner.getValue()");
+ }
+ boolean reverse = suffixReverse.isSelected();
+ boolean keepAll = backupfilesKeepAll.isSelected();
+ int rollMax = 4;
+ try
+ {
+ backupfilesRollMaxSpinner.commitEdit();
+ rollMax = (Integer) backupfilesRollMaxSpinner.getValue();
+ rollMax = rollMax < 1 ? 1 : rollMax;
+ } catch (Exception e)
+ {
+ System.out.println(
+ "Failed casting (Integer) backupfilesRollMaxSpinner.getValue()");
+ }
+
+ int lowersurround = 2;
+ int uppersurround = 0;
+ StringBuilder exampleSB = new StringBuilder();
+ boolean firstLine = true;
+ if (reverse)
+ {
+
+ int min = 1;
+ int max = keepAll ? exampleindex : rollMax;
+ for (int index = min; index <= max; index++)
+ {
+ if (index == min + lowersurround && index < max - uppersurround - 1)
+ {
+ exampleSB.append("\n...");
+ }
+ else if (index > min + lowersurround && index < max - uppersurround)
+ {
+ // nothing
+ }
+ else
+ {
+ if (firstLine)
+ {
+ firstLine = false;
+ }
+ else
+ {
+ exampleSB.append("\n");
+ }
+ exampleSB.append(BackupFilenameFilter.getBackupFilename(index,
+ base, suffix, digits, extension));
+ if (min == max)
+ {
+ // no extra text needed
+ }
+ else if (index == min)
+ {
+ String newest = MessageManager.getString("label.braced_newest");
+ if (newest != null && newest.length() > 0)
+ {
+ exampleSB.append(" "+newest);
+ }
+ }
+ else if (index == max)
+ {
+ String oldest = MessageManager.getString("label.braced_oldest");
+ if (oldest != null && oldest.length() > 0)
+ {
+ exampleSB.append(" "+oldest);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+
+ int min = (keepAll || exampleindex - rollMax < 0) ? 1
+ : exampleindex - rollMax + 1;
+ int max = exampleindex;
+
+ for (int index = min; index <= max; index++)
+ {
+
+ if (index == min + lowersurround && index < max - uppersurround - 1)
+ {
+ exampleSB.append("\n...");
+ }
+ else if (index > min + lowersurround && index < max - uppersurround)
+ {
+ // nothing
+ }
+ else
+ {
+ if (firstLine)
+ {
+ firstLine = false;
+ }
+ else
+ {
+ exampleSB.append("\n");
+ }
+ exampleSB.append(BackupFilenameFilter.getBackupFilename(index,
+ base, suffix, digits, extension));
+ if (min == max)
+ {
+ // no extra text needed
+ }
+ else if (index == min)
+ {
+ String oldest = MessageManager.getString("label.braced_oldest");
+ if (oldest != null && oldest.length() > 0)
+ {
+ exampleSB.append(" "+oldest);
+ }
+ }
+ else if (index == max)
+ {
+ String newest = MessageManager.getString("label.braced_newest");
+ if (newest != null && newest.length() > 0)
+ {
+ exampleSB.append(" "+newest);
+ }
+ }
+ }
+ }
+
+ }
+
+ backupfilesExampleLabel.setText(exampleSB.toString());
+ }
+
+ protected void setIntegerSpinner(JSpinner s, int min, int max, int def,
+ boolean useExistingVal, ChangeListener c)
+ {
+ int i = def;
+ if (useExistingVal)
+ {
+ try
+ {
+ i = Integer.parseInt((String) s.getValue());
+ } catch (Exception e)
+ {
+ System.out.println(
+ "Exception casting the initial value of s.getValue()");
+ }
+ }
+
+ setIntegerSpinner(s, min, max, i, c);
+ }
+
+ protected void setIntegerSpinner(JSpinner s, int min, int max, int def,
+ ChangeListener c)
+ {
+ // integer spinner for number of digits
+ if (def > max)
+ {
+ max = def;
+ }
+ SpinnerModel sModel = new SpinnerNumberModel(def, min, max, 1);
+ s.setModel(sModel);
+
+ s.addChangeListener(c);
+
+ }
+
+ public static int getSpinnerInt(JSpinner s, int def)
+ {
+ int i = def;
+ try
+ {
+ s.commitEdit();
+ i = (Integer) s.getValue();
+ } catch (Exception e)
+ {
+ System.out.println("Failed casting (Integer) JSpinner s.getValue()");
+ }
+ return i;
+ }
+
+ private void keepRollMaxOptionsEnabled(boolean enabled)
+ {
+ oldBackupFilesLabel.setEnabled(enabled);
+ backupfilesRollMaxSpinner.setEnabled(enabled);
+ backupfilesConfirmDelete.setEnabled(enabled);
+
+ }
+
+ protected void backupsOptionsSetEnabled(boolean enabled)
+ {
+ suffixPanel.setEnabled(enabled);
+ keepfilesPanel.setEnabled(enabled);
+ exampleFilesPanel.setEnabled(enabled);
+
+ suffixTemplate.setEnabled(enabled);
+ suffixTemplateLabel.setEnabled(enabled);
+ suffixDigitsLabel.setEnabled(enabled);
+ suffixDigitsSpinner.setEnabled(enabled);
+ suffixReverse.setEnabled(enabled);
+ backupfilesKeepAll.setEnabled(enabled);
+ backupfilesRollMaxSpinner.setEnabled(enabled);
+ oldBackupFilesLabel.setEnabled(enabled);
+ backupfilesConfirmDelete.setEnabled(enabled);
+ backupfilesExampleLabel.setEnabled(enabled);
+
+ keepRollMaxOptionsEnabled(enabled && !backupfilesKeepAll.isSelected());
+ }
+
protected void autoIdWidth_actionPerformed()
{
// TODO Auto-generated method stub
import jalview.gui.StructureViewer.ViewerType;
import jalview.gui.StructureViewerBase;
import jalview.gui.TreePanel;
+import jalview.io.BackupFiles;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.NewickFile;
public void saveState(File statefile)
{
FileOutputStream fos = null;
+ // create backupfiles object and get new temp filename destination
+ BackupFiles backupfiles = new BackupFiles(statefile);
+
try
{
- fos = new FileOutputStream(statefile);
+
+ fos = new FileOutputStream(backupfiles.getTempFilePath());
+
JarOutputStream jout = new JarOutputStream(fos);
saveState(jout);
+ fos.close();
+ backupfiles.setWriteSuccess(true);
+ backupfiles.rollBackupsAndRenameTempFile();
} catch (Exception e)
{
+ Cache.log.error("Couln't write Jalview state to " + statefile
+ + ". Temporary file is at: " + backupfiles.getTempFile(), e);
// TODO: inform user of the problem - they need to know if their data was
// not saved !
if (errorMessage == null)
{
- errorMessage = "Couldn't write Jalview Archive to output file '"
+ errorMessage = "Did't write Jalview Archive to output file '"
+ statefile + "' - See console error log for details";
}
else
{
- errorMessage += "(output file was '" + statefile + "')";
+ errorMessage += "(Didn't write Jalview Archive to output file '"
+ + statefile + "\nTemporary file is at: "
+ + backupfiles.getTempFile() + ")";
}
e.printStackTrace();
} finally
{
try
{
- FileOutputStream fos = new FileOutputStream(jarFile);
+ // create backupfiles object and get new temp filename destination
+ BackupFiles backupfiles = new BackupFiles(jarFile);
+ FileOutputStream fos = new FileOutputStream(
+ backupfiles.getTempFilePath());
+
JarOutputStream jout = new JarOutputStream(fos);
List<AlignFrame> frames = new ArrayList<>();
}
;
jout.close();
- return true;
+ boolean success = true;
+
+ backupfiles.setWriteSuccess(success);
+ success = backupfiles.rollBackupsAndRenameTempFile();
+
+ return success;
} catch (Exception ex)
{
errorMessage = "Couldn't Write alignment view to Jalview Archive - see error output for details";
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * endpoints of X, Y and Z axes in that order
- *
- *
- * @version $Revision$ $Date$
- */
-public class Axis implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _xPos.
- */
- private float _xPos;
-
- /**
- * keeps track of state for field: _xPos
- */
- private boolean _has_xPos;
-
- /**
- * Field _yPos.
- */
- private float _yPos;
-
- /**
- * keeps track of state for field: _yPos
- */
- private boolean _has_yPos;
-
- /**
- * Field _zPos.
- */
- private float _zPos;
-
- /**
- * keeps track of state for field: _zPos
- */
- private boolean _has_zPos;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public Axis()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- */
- public void deleteXPos()
- {
- this._has_xPos = false;
- }
-
- /**
- */
- public void deleteYPos()
- {
- this._has_yPos = false;
- }
-
- /**
- */
- public void deleteZPos()
- {
- this._has_zPos = false;
- }
-
- /**
- * Returns the value of field 'xPos'.
- *
- * @return the value of field 'XPos'.
- */
- public float getXPos()
- {
- return this._xPos;
- }
-
- /**
- * Returns the value of field 'yPos'.
- *
- * @return the value of field 'YPos'.
- */
- public float getYPos()
- {
- return this._yPos;
- }
-
- /**
- * Returns the value of field 'zPos'.
- *
- * @return the value of field 'ZPos'.
- */
- public float getZPos()
- {
- return this._zPos;
- }
-
- /**
- * Method hasXPos.
- *
- * @return true if at least one XPos has been added
- */
- public boolean hasXPos()
- {
- return this._has_xPos;
- }
-
- /**
- * Method hasYPos.
- *
- * @return true if at least one YPos has been added
- */
- public boolean hasYPos()
- {
- return this._has_yPos;
- }
-
- /**
- * Method hasZPos.
- *
- * @return true if at least one ZPos has been added
- */
- public boolean hasZPos()
- {
- return this._has_zPos;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'xPos'.
- *
- * @param xPos
- * the value of field 'xPos'.
- */
- public void setXPos(final float xPos)
- {
- this._xPos = xPos;
- this._has_xPos = true;
- }
-
- /**
- * Sets the value of field 'yPos'.
- *
- * @param yPos
- * the value of field 'yPos'.
- */
- public void setYPos(final float yPos)
- {
- this._yPos = yPos;
- this._has_yPos = true;
- }
-
- /**
- * Sets the value of field 'zPos'.
- *
- * @param zPos
- * the value of field 'zPos'.
- */
- public void setZPos(final float zPos)
- {
- this._zPos = zPos;
- this._has_zPos = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.Axis
- */
- public static jalview.schemabinding.version2.Axis unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.Axis) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.Axis.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class D.
- *
- * @version $Revision$ $Date$
- */
-public class D extends DoubleVector implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public D()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
- */
- public static jalview.schemabinding.version2.DoubleVector unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.D.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class DoubleMatrix.
- *
- * @version $Revision$ $Date$
- */
-public class DoubleMatrix implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _rows.
- */
- private int _rows;
-
- /**
- * keeps track of state for field: _rows
- */
- private boolean _has_rows;
-
- /**
- * Field _columns.
- */
- private int _columns;
-
- /**
- * keeps track of state for field: _columns
- */
- private boolean _has_columns;
-
- /**
- * Field _rowList.
- */
- private java.util.Vector _rowList;
-
- /**
- * Field _d.
- */
- private jalview.schemabinding.version2.D _d;
-
- /**
- * Field _e.
- */
- private jalview.schemabinding.version2.E _e;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public DoubleMatrix()
- {
- super();
- this._rowList = new java.util.Vector();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- *
- *
- * @param vRow
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addRow(final jalview.schemabinding.version2.Row vRow)
- throws java.lang.IndexOutOfBoundsException
- {
- this._rowList.addElement(vRow);
- }
-
- /**
- *
- *
- * @param index
- * @param vRow
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addRow(final int index,
- final jalview.schemabinding.version2.Row vRow)
- throws java.lang.IndexOutOfBoundsException
- {
- this._rowList.add(index, vRow);
- }
-
- /**
- */
- public void deleteColumns()
- {
- this._has_columns = false;
- }
-
- /**
- */
- public void deleteRows()
- {
- this._has_rows = false;
- }
-
- /**
- * Method enumerateRow.
- *
- * @return an Enumeration over all jalview.schemabinding.version2.Row elements
- */
- public java.util.Enumeration enumerateRow()
- {
- return this._rowList.elements();
- }
-
- /**
- * Returns the value of field 'columns'.
- *
- * @return the value of field 'Columns'.
- */
- public int getColumns()
- {
- return this._columns;
- }
-
- /**
- * Returns the value of field 'd'.
- *
- * @return the value of field 'D'.
- */
- public jalview.schemabinding.version2.D getD()
- {
- return this._d;
- }
-
- /**
- * Returns the value of field 'e'.
- *
- * @return the value of field 'E'.
- */
- public jalview.schemabinding.version2.E getE()
- {
- return this._e;
- }
-
- /**
- * Method getRow.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.Row at the given
- * index
- */
- public jalview.schemabinding.version2.Row getRow(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._rowList.size())
- {
- throw new IndexOutOfBoundsException("getRow: Index value '" + index
- + "' not in range [0.." + (this._rowList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.Row) _rowList.get(index);
- }
-
- /**
- * Method getRow.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.Row[] getRow()
- {
- jalview.schemabinding.version2.Row[] array = new jalview.schemabinding.version2.Row[0];
- return (jalview.schemabinding.version2.Row[]) this._rowList
- .toArray(array);
- }
-
- /**
- * Method getRowCount.
- *
- * @return the size of this collection
- */
- public int getRowCount()
- {
- return this._rowList.size();
- }
-
- /**
- * Returns the value of field 'rows'.
- *
- * @return the value of field 'Rows'.
- */
- public int getRows()
- {
- return this._rows;
- }
-
- /**
- * Method hasColumns.
- *
- * @return true if at least one Columns has been added
- */
- public boolean hasColumns()
- {
- return this._has_columns;
- }
-
- /**
- * Method hasRows.
- *
- * @return true if at least one Rows has been added
- */
- public boolean hasRows()
- {
- return this._has_rows;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllRow()
- {
- this._rowList.clear();
- }
-
- /**
- * Method removeRow.
- *
- * @param vRow
- * @return true if the object was removed from the collection.
- */
- public boolean removeRow(final jalview.schemabinding.version2.Row vRow)
- {
- boolean removed = _rowList.remove(vRow);
- return removed;
- }
-
- /**
- * Method removeRowAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.Row removeRowAt(final int index)
- {
- java.lang.Object obj = this._rowList.remove(index);
- return (jalview.schemabinding.version2.Row) obj;
- }
-
- /**
- * Sets the value of field 'columns'.
- *
- * @param columns
- * the value of field 'columns'.
- */
- public void setColumns(final int columns)
- {
- this._columns = columns;
- this._has_columns = true;
- }
-
- /**
- * Sets the value of field 'd'.
- *
- * @param d
- * the value of field 'd'.
- */
- public void setD(final jalview.schemabinding.version2.D d)
- {
- this._d = d;
- }
-
- /**
- * Sets the value of field 'e'.
- *
- * @param e
- * the value of field 'e'.
- */
- public void setE(final jalview.schemabinding.version2.E e)
- {
- this._e = e;
- }
-
- /**
- *
- *
- * @param index
- * @param vRow
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setRow(final int index,
- final jalview.schemabinding.version2.Row vRow)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._rowList.size())
- {
- throw new IndexOutOfBoundsException("setRow: Index value '" + index
- + "' not in range [0.." + (this._rowList.size() - 1) + "]");
- }
-
- this._rowList.set(index, vRow);
- }
-
- /**
- *
- *
- * @param vRowArray
- */
- public void setRow(final jalview.schemabinding.version2.Row[] vRowArray)
- {
- // -- copy array
- _rowList.clear();
-
- for (int i = 0; i < vRowArray.length; i++)
- {
- this._rowList.add(vRowArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'rows'.
- *
- * @param rows
- * the value of field 'rows'.
- */
- public void setRows(final int rows)
- {
- this._rows = rows;
- this._has_rows = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
- */
- public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.DoubleMatrix.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class DoubleVector.
- *
- * @version $Revision$ $Date$
- */
-public class DoubleVector implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _vList.
- */
- private java.util.Vector _vList;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public DoubleVector()
- {
- super();
- this._vList = new java.util.Vector();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- *
- *
- * @param vV
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addV(final double vV)
- throws java.lang.IndexOutOfBoundsException
- {
- this._vList.addElement(new java.lang.Double(vV));
- }
-
- /**
- *
- *
- * @param index
- * @param vV
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addV(final int index, final double vV)
- throws java.lang.IndexOutOfBoundsException
- {
- this._vList.add(index, new java.lang.Double(vV));
- }
-
- /**
- * Method enumerateV.
- *
- * @return an Enumeration over all double elements
- */
- public java.util.Enumeration enumerateV()
- {
- return this._vList.elements();
- }
-
- /**
- * Method getV.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the double at the given index
- */
- public double getV(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._vList.size())
- {
- throw new IndexOutOfBoundsException("getV: Index value '" + index
- + "' not in range [0.." + (this._vList.size() - 1) + "]");
- }
-
- return ((java.lang.Double) _vList.get(index)).doubleValue();
- }
-
- /**
- * Method getV.Returns the contents of the collection in an Array.
- *
- * @return this collection as an Array
- */
- public double[] getV()
- {
- int size = this._vList.size();
- double[] array = new double[size];
- java.util.Iterator iter = _vList.iterator();
- for (int index = 0; index < size; index++)
- {
- array[index] = ((java.lang.Double) iter.next()).doubleValue();
- }
- return array;
- }
-
- /**
- * Method getVCount.
- *
- * @return the size of this collection
- */
- public int getVCount()
- {
- return this._vList.size();
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllV()
- {
- this._vList.clear();
- }
-
- /**
- * Method removeV.
- *
- * @param vV
- * @return true if the object was removed from the collection.
- */
- public boolean removeV(final double vV)
- {
- boolean removed = _vList.remove(new java.lang.Double(vV));
- return removed;
- }
-
- /**
- * Method removeVAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public double removeVAt(final int index)
- {
- java.lang.Object obj = this._vList.remove(index);
- return ((java.lang.Double) obj).doubleValue();
- }
-
- /**
- *
- *
- * @param index
- * @param vV
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setV(final int index, final double vV)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._vList.size())
- {
- throw new IndexOutOfBoundsException("setV: Index value '" + index
- + "' not in range [0.." + (this._vList.size() - 1) + "]");
- }
-
- this._vList.set(index, new java.lang.Double(vV));
- }
-
- /**
- *
- *
- * @param vVArray
- */
- public void setV(final double[] vVArray)
- {
- // -- copy array
- _vList.clear();
-
- for (int i = 0; i < vVArray.length; i++)
- {
- this._vList.add(new java.lang.Double(vVArray[i]));
- }
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
- */
- public static jalview.schemabinding.version2.DoubleVector unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.DoubleVector.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class E.
- *
- * @version $Revision$ $Date$
- */
-public class E extends DoubleVector implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public E()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
- */
- public static jalview.schemabinding.version2.DoubleVector unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.E.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class EigenMatrix.
- *
- * @version $Revision$ $Date$
- */
-public class EigenMatrix extends DoubleMatrix
- implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public EigenMatrix()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
- */
- public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.EigenMatrix.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class PairwiseMatrix.
- *
- * @version $Revision$ $Date$
- */
-public class PairwiseMatrix extends DoubleMatrix
- implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PairwiseMatrix()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
- */
- public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.PairwiseMatrix.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class PcaData.
- *
- * @version $Revision$ $Date$
- */
-public class PcaData extends PcaDataType implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaData()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.PcaDataType
- */
- public static jalview.schemabinding.version2.PcaDataType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.PcaDataType) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.PcaData.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * The results of a PCA calculation
- *
- *
- * @version $Revision$ $Date$
- */
-public class PcaDataType implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _pairwiseMatrix.
- */
- private jalview.schemabinding.version2.PairwiseMatrix _pairwiseMatrix;
-
- /**
- * Field _tridiagonalMatrix.
- */
- private jalview.schemabinding.version2.TridiagonalMatrix _tridiagonalMatrix;
-
- /**
- * Field _eigenMatrix.
- */
- private jalview.schemabinding.version2.EigenMatrix _eigenMatrix;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaDataType()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Returns the value of field 'eigenMatrix'.
- *
- * @return the value of field 'EigenMatrix'.
- */
- public jalview.schemabinding.version2.EigenMatrix getEigenMatrix()
- {
- return this._eigenMatrix;
- }
-
- /**
- * Returns the value of field 'pairwiseMatrix'.
- *
- * @return the value of field 'PairwiseMatrix'.
- */
- public jalview.schemabinding.version2.PairwiseMatrix getPairwiseMatrix()
- {
- return this._pairwiseMatrix;
- }
-
- /**
- * Returns the value of field 'tridiagonalMatrix'.
- *
- * @return the value of field 'TridiagonalMatrix'.
- */
- public jalview.schemabinding.version2.TridiagonalMatrix getTridiagonalMatrix()
- {
- return this._tridiagonalMatrix;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'eigenMatrix'.
- *
- * @param eigenMatrix
- * the value of field 'eigenMatrix'.
- */
- public void setEigenMatrix(
- final jalview.schemabinding.version2.EigenMatrix eigenMatrix)
- {
- this._eigenMatrix = eigenMatrix;
- }
-
- /**
- * Sets the value of field 'pairwiseMatrix'.
- *
- * @param pairwiseMatrix
- * the value of field 'pairwiseMatrix'.
- */
- public void setPairwiseMatrix(
- final jalview.schemabinding.version2.PairwiseMatrix pairwiseMatrix)
- {
- this._pairwiseMatrix = pairwiseMatrix;
- }
-
- /**
- * Sets the value of field 'tridiagonalMatrix'.
- *
- * @param tridiagonalMatrix
- * the value of field 'tridiagonalMatrix'.
- */
- public void setTridiagonalMatrix(
- final jalview.schemabinding.version2.TridiagonalMatrix tridiagonalMatrix)
- {
- this._tridiagonalMatrix = tridiagonalMatrix;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.PcaDataType
- */
- public static jalview.schemabinding.version2.PcaDataType unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.PcaDataType) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.PcaDataType.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class PcaViewer.
- *
- * @version $Revision$ $Date$
- */
-public class PcaViewer implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _title.
- */
- private java.lang.String _title;
-
- /**
- * Field _scoreModelName.
- */
- private java.lang.String _scoreModelName;
-
- /**
- * Field _xDim.
- */
- private int _xDim;
-
- /**
- * keeps track of state for field: _xDim
- */
- private boolean _has_xDim;
-
- /**
- * Field _yDim.
- */
- private int _yDim;
-
- /**
- * keeps track of state for field: _yDim
- */
- private boolean _has_yDim;
-
- /**
- * Field _zDim.
- */
- private int _zDim;
-
- /**
- * keeps track of state for field: _zDim
- */
- private boolean _has_zDim;
-
- /**
- * Field _bgColour.
- */
- private int _bgColour;
-
- /**
- * keeps track of state for field: _bgColour
- */
- private boolean _has_bgColour;
-
- /**
- * Field _scaleFactor.
- */
- private float _scaleFactor;
-
- /**
- * keeps track of state for field: _scaleFactor
- */
- private boolean _has_scaleFactor;
-
- /**
- * Field _showLabels.
- */
- private boolean _showLabels;
-
- /**
- * keeps track of state for field: _showLabels
- */
- private boolean _has_showLabels;
-
- /**
- * Field _linkToAllViews.
- */
- private boolean _linkToAllViews;
-
- /**
- * keeps track of state for field: _linkToAllViews
- */
- private boolean _has_linkToAllViews;
-
- /**
- * Field _includeGaps.
- */
- private boolean _includeGaps;
-
- /**
- * keeps track of state for field: _includeGaps
- */
- private boolean _has_includeGaps;
-
- /**
- * Field _matchGaps.
- */
- private boolean _matchGaps;
-
- /**
- * keeps track of state for field: _matchGaps
- */
- private boolean _has_matchGaps;
-
- /**
- * Field _includeGappedColumns.
- */
- private boolean _includeGappedColumns;
-
- /**
- * keeps track of state for field: _includeGappedColumns
- */
- private boolean _has_includeGappedColumns;
-
- /**
- * Field _denominateByShortestLength.
- */
- private boolean _denominateByShortestLength;
-
- /**
- * keeps track of state for field: _denominateByShortestLength
- */
- private boolean _has_denominateByShortestLength;
-
- /**
- * Field _width.
- */
- private int _width;
-
- /**
- * keeps track of state for field: _width
- */
- private boolean _has_width;
-
- /**
- * Field _height.
- */
- private int _height;
-
- /**
- * keeps track of state for field: _height
- */
- private boolean _has_height;
-
- /**
- * Field _xpos.
- */
- private int _xpos;
-
- /**
- * keeps track of state for field: _xpos
- */
- private boolean _has_xpos;
-
- /**
- * Field _ypos.
- */
- private int _ypos;
-
- /**
- * keeps track of state for field: _ypos
- */
- private boolean _has_ypos;
-
- /**
- * Field _sequencePointList.
- */
- private java.util.Vector _sequencePointList;
-
- /**
- * endpoints of X, Y and Z axes in that order
- *
- */
- private java.util.Vector _axisList;
-
- /**
- * Field _seqPointMin.
- */
- private jalview.schemabinding.version2.SeqPointMin _seqPointMin;
-
- /**
- * Field _seqPointMax.
- */
- private jalview.schemabinding.version2.SeqPointMax _seqPointMax;
-
- /**
- * Field _pcaData.
- */
- private jalview.schemabinding.version2.PcaData _pcaData;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaViewer()
- {
- super();
- this._sequencePointList = new java.util.Vector();
- this._axisList = new java.util.Vector();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- *
- *
- * @param vAxis
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addAxis(final jalview.schemabinding.version2.Axis vAxis)
- throws java.lang.IndexOutOfBoundsException
- {
- // check for the maximum size
- if (this._axisList.size() >= 3)
- {
- throw new IndexOutOfBoundsException("addAxis has a maximum of 3");
- }
-
- this._axisList.addElement(vAxis);
- }
-
- /**
- *
- *
- * @param index
- * @param vAxis
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addAxis(final int index,
- final jalview.schemabinding.version2.Axis vAxis)
- throws java.lang.IndexOutOfBoundsException
- {
- // check for the maximum size
- if (this._axisList.size() >= 3)
- {
- throw new IndexOutOfBoundsException("addAxis has a maximum of 3");
- }
-
- this._axisList.add(index, vAxis);
- }
-
- /**
- *
- *
- * @param vSequencePoint
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addSequencePoint(
- final jalview.schemabinding.version2.SequencePoint vSequencePoint)
- throws java.lang.IndexOutOfBoundsException
- {
- this._sequencePointList.addElement(vSequencePoint);
- }
-
- /**
- *
- *
- * @param index
- * @param vSequencePoint
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void addSequencePoint(final int index,
- final jalview.schemabinding.version2.SequencePoint vSequencePoint)
- throws java.lang.IndexOutOfBoundsException
- {
- this._sequencePointList.add(index, vSequencePoint);
- }
-
- /**
- */
- public void deleteBgColour()
- {
- this._has_bgColour = false;
- }
-
- /**
- */
- public void deleteDenominateByShortestLength()
- {
- this._has_denominateByShortestLength = false;
- }
-
- /**
- */
- public void deleteHeight()
- {
- this._has_height = false;
- }
-
- /**
- */
- public void deleteIncludeGappedColumns()
- {
- this._has_includeGappedColumns = false;
- }
-
- /**
- */
- public void deleteIncludeGaps()
- {
- this._has_includeGaps = false;
- }
-
- /**
- */
- public void deleteLinkToAllViews()
- {
- this._has_linkToAllViews = false;
- }
-
- /**
- */
- public void deleteMatchGaps()
- {
- this._has_matchGaps = false;
- }
-
- /**
- */
- public void deleteScaleFactor()
- {
- this._has_scaleFactor = false;
- }
-
- /**
- */
- public void deleteShowLabels()
- {
- this._has_showLabels = false;
- }
-
- /**
- */
- public void deleteWidth()
- {
- this._has_width = false;
- }
-
- /**
- */
- public void deleteXDim()
- {
- this._has_xDim = false;
- }
-
- /**
- */
- public void deleteXpos()
- {
- this._has_xpos = false;
- }
-
- /**
- */
- public void deleteYDim()
- {
- this._has_yDim = false;
- }
-
- /**
- */
- public void deleteYpos()
- {
- this._has_ypos = false;
- }
-
- /**
- */
- public void deleteZDim()
- {
- this._has_zDim = false;
- }
-
- /**
- * Method enumerateAxis.
- *
- * @return an Enumeration over all jalview.schemabinding.version2.Axis
- * elements
- */
- public java.util.Enumeration enumerateAxis()
- {
- return this._axisList.elements();
- }
-
- /**
- * Method enumerateSequencePoint.
- *
- * @return an Enumeration over all
- * jalview.schemabinding.version2.SequencePoint elements
- */
- public java.util.Enumeration enumerateSequencePoint()
- {
- return this._sequencePointList.elements();
- }
-
- /**
- * Method getAxis.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.Axis at the given
- * index
- */
- public jalview.schemabinding.version2.Axis getAxis(final int index)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._axisList.size())
- {
- throw new IndexOutOfBoundsException("getAxis: Index value '" + index
- + "' not in range [0.." + (this._axisList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.Axis) _axisList.get(index);
- }
-
- /**
- * Method getAxis.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.Axis[] getAxis()
- {
- jalview.schemabinding.version2.Axis[] array = new jalview.schemabinding.version2.Axis[0];
- return (jalview.schemabinding.version2.Axis[]) this._axisList
- .toArray(array);
- }
-
- /**
- * Method getAxisCount.
- *
- * @return the size of this collection
- */
- public int getAxisCount()
- {
- return this._axisList.size();
- }
-
- /**
- * Returns the value of field 'bgColour'.
- *
- * @return the value of field 'BgColour'.
- */
- public int getBgColour()
- {
- return this._bgColour;
- }
-
- /**
- * Returns the value of field 'denominateByShortestLength'.
- *
- * @return the value of field 'DenominateByShortestLength'.
- */
- public boolean getDenominateByShortestLength()
- {
- return this._denominateByShortestLength;
- }
-
- /**
- * Returns the value of field 'height'.
- *
- * @return the value of field 'Height'.
- */
- public int getHeight()
- {
- return this._height;
- }
-
- /**
- * Returns the value of field 'includeGappedColumns'.
- *
- * @return the value of field 'IncludeGappedColumns'.
- */
- public boolean getIncludeGappedColumns()
- {
- return this._includeGappedColumns;
- }
-
- /**
- * Returns the value of field 'includeGaps'.
- *
- * @return the value of field 'IncludeGaps'.
- */
- public boolean getIncludeGaps()
- {
- return this._includeGaps;
- }
-
- /**
- * Returns the value of field 'linkToAllViews'.
- *
- * @return the value of field 'LinkToAllViews'.
- */
- public boolean getLinkToAllViews()
- {
- return this._linkToAllViews;
- }
-
- /**
- * Returns the value of field 'matchGaps'.
- *
- * @return the value of field 'MatchGaps'.
- */
- public boolean getMatchGaps()
- {
- return this._matchGaps;
- }
-
- /**
- * Returns the value of field 'pcaData'.
- *
- * @return the value of field 'PcaData'.
- */
- public jalview.schemabinding.version2.PcaData getPcaData()
- {
- return this._pcaData;
- }
-
- /**
- * Returns the value of field 'scaleFactor'.
- *
- * @return the value of field 'ScaleFactor'.
- */
- public float getScaleFactor()
- {
- return this._scaleFactor;
- }
-
- /**
- * Returns the value of field 'scoreModelName'.
- *
- * @return the value of field 'ScoreModelName'.
- */
- public java.lang.String getScoreModelName()
- {
- return this._scoreModelName;
- }
-
- /**
- * Returns the value of field 'seqPointMax'.
- *
- * @return the value of field 'SeqPointMax'.
- */
- public jalview.schemabinding.version2.SeqPointMax getSeqPointMax()
- {
- return this._seqPointMax;
- }
-
- /**
- * Returns the value of field 'seqPointMin'.
- *
- * @return the value of field 'SeqPointMin'.
- */
- public jalview.schemabinding.version2.SeqPointMin getSeqPointMin()
- {
- return this._seqPointMin;
- }
-
- /**
- * Method getSequencePoint.
- *
- * @param index
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- * @return the value of the jalview.schemabinding.version2.SequencePoint at
- * the given index
- */
- public jalview.schemabinding.version2.SequencePoint getSequencePoint(
- final int index) throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._sequencePointList.size())
- {
- throw new IndexOutOfBoundsException("getSequencePoint: Index value '"
- + index + "' not in range [0.."
- + (this._sequencePointList.size() - 1) + "]");
- }
-
- return (jalview.schemabinding.version2.SequencePoint) _sequencePointList
- .get(index);
- }
-
- /**
- * Method getSequencePoint.Returns the contents of the collection in an Array.
- * <p>
- * Note: Just in case the collection contents are changing in another thread,
- * we pass a 0-length Array of the correct type into the API call. This way we
- * <i>know</i> that the Array returned is of exactly the correct length.
- *
- * @return this collection as an Array
- */
- public jalview.schemabinding.version2.SequencePoint[] getSequencePoint()
- {
- jalview.schemabinding.version2.SequencePoint[] array = new jalview.schemabinding.version2.SequencePoint[0];
- return (jalview.schemabinding.version2.SequencePoint[]) this._sequencePointList
- .toArray(array);
- }
-
- /**
- * Method getSequencePointCount.
- *
- * @return the size of this collection
- */
- public int getSequencePointCount()
- {
- return this._sequencePointList.size();
- }
-
- /**
- * Returns the value of field 'showLabels'.
- *
- * @return the value of field 'ShowLabels'.
- */
- public boolean getShowLabels()
- {
- return this._showLabels;
- }
-
- /**
- * Returns the value of field 'title'.
- *
- * @return the value of field 'Title'.
- */
- public java.lang.String getTitle()
- {
- return this._title;
- }
-
- /**
- * Returns the value of field 'width'.
- *
- * @return the value of field 'Width'.
- */
- public int getWidth()
- {
- return this._width;
- }
-
- /**
- * Returns the value of field 'xDim'.
- *
- * @return the value of field 'XDim'.
- */
- public int getXDim()
- {
- return this._xDim;
- }
-
- /**
- * Returns the value of field 'xpos'.
- *
- * @return the value of field 'Xpos'.
- */
- public int getXpos()
- {
- return this._xpos;
- }
-
- /**
- * Returns the value of field 'yDim'.
- *
- * @return the value of field 'YDim'.
- */
- public int getYDim()
- {
- return this._yDim;
- }
-
- /**
- * Returns the value of field 'ypos'.
- *
- * @return the value of field 'Ypos'.
- */
- public int getYpos()
- {
- return this._ypos;
- }
-
- /**
- * Returns the value of field 'zDim'.
- *
- * @return the value of field 'ZDim'.
- */
- public int getZDim()
- {
- return this._zDim;
- }
-
- /**
- * Method hasBgColour.
- *
- * @return true if at least one BgColour has been added
- */
- public boolean hasBgColour()
- {
- return this._has_bgColour;
- }
-
- /**
- * Method hasDenominateByShortestLength.
- *
- * @return true if at least one DenominateByShortestLength has been added
- */
- public boolean hasDenominateByShortestLength()
- {
- return this._has_denominateByShortestLength;
- }
-
- /**
- * Method hasHeight.
- *
- * @return true if at least one Height has been added
- */
- public boolean hasHeight()
- {
- return this._has_height;
- }
-
- /**
- * Method hasIncludeGappedColumns.
- *
- * @return true if at least one IncludeGappedColumns has been added
- */
- public boolean hasIncludeGappedColumns()
- {
- return this._has_includeGappedColumns;
- }
-
- /**
- * Method hasIncludeGaps.
- *
- * @return true if at least one IncludeGaps has been added
- */
- public boolean hasIncludeGaps()
- {
- return this._has_includeGaps;
- }
-
- /**
- * Method hasLinkToAllViews.
- *
- * @return true if at least one LinkToAllViews has been added
- */
- public boolean hasLinkToAllViews()
- {
- return this._has_linkToAllViews;
- }
-
- /**
- * Method hasMatchGaps.
- *
- * @return true if at least one MatchGaps has been added
- */
- public boolean hasMatchGaps()
- {
- return this._has_matchGaps;
- }
-
- /**
- * Method hasScaleFactor.
- *
- * @return true if at least one ScaleFactor has been added
- */
- public boolean hasScaleFactor()
- {
- return this._has_scaleFactor;
- }
-
- /**
- * Method hasShowLabels.
- *
- * @return true if at least one ShowLabels has been added
- */
- public boolean hasShowLabels()
- {
- return this._has_showLabels;
- }
-
- /**
- * Method hasWidth.
- *
- * @return true if at least one Width has been added
- */
- public boolean hasWidth()
- {
- return this._has_width;
- }
-
- /**
- * Method hasXDim.
- *
- * @return true if at least one XDim has been added
- */
- public boolean hasXDim()
- {
- return this._has_xDim;
- }
-
- /**
- * Method hasXpos.
- *
- * @return true if at least one Xpos has been added
- */
- public boolean hasXpos()
- {
- return this._has_xpos;
- }
-
- /**
- * Method hasYDim.
- *
- * @return true if at least one YDim has been added
- */
- public boolean hasYDim()
- {
- return this._has_yDim;
- }
-
- /**
- * Method hasYpos.
- *
- * @return true if at least one Ypos has been added
- */
- public boolean hasYpos()
- {
- return this._has_ypos;
- }
-
- /**
- * Method hasZDim.
- *
- * @return true if at least one ZDim has been added
- */
- public boolean hasZDim()
- {
- return this._has_zDim;
- }
-
- /**
- * Returns the value of field 'denominateByShortestLength'.
- *
- * @return the value of field 'DenominateByShortestLength'.
- */
- public boolean isDenominateByShortestLength()
- {
- return this._denominateByShortestLength;
- }
-
- /**
- * Returns the value of field 'includeGappedColumns'.
- *
- * @return the value of field 'IncludeGappedColumns'.
- */
- public boolean isIncludeGappedColumns()
- {
- return this._includeGappedColumns;
- }
-
- /**
- * Returns the value of field 'includeGaps'.
- *
- * @return the value of field 'IncludeGaps'.
- */
- public boolean isIncludeGaps()
- {
- return this._includeGaps;
- }
-
- /**
- * Returns the value of field 'linkToAllViews'.
- *
- * @return the value of field 'LinkToAllViews'.
- */
- public boolean isLinkToAllViews()
- {
- return this._linkToAllViews;
- }
-
- /**
- * Returns the value of field 'matchGaps'.
- *
- * @return the value of field 'MatchGaps'.
- */
- public boolean isMatchGaps()
- {
- return this._matchGaps;
- }
-
- /**
- * Returns the value of field 'showLabels'.
- *
- * @return the value of field 'ShowLabels'.
- */
- public boolean isShowLabels()
- {
- return this._showLabels;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- */
- public void removeAllAxis()
- {
- this._axisList.clear();
- }
-
- /**
- */
- public void removeAllSequencePoint()
- {
- this._sequencePointList.clear();
- }
-
- /**
- * Method removeAxis.
- *
- * @param vAxis
- * @return true if the object was removed from the collection.
- */
- public boolean removeAxis(final jalview.schemabinding.version2.Axis vAxis)
- {
- boolean removed = _axisList.remove(vAxis);
- return removed;
- }
-
- /**
- * Method removeAxisAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.Axis removeAxisAt(final int index)
- {
- java.lang.Object obj = this._axisList.remove(index);
- return (jalview.schemabinding.version2.Axis) obj;
- }
-
- /**
- * Method removeSequencePoint.
- *
- * @param vSequencePoint
- * @return true if the object was removed from the collection.
- */
- public boolean removeSequencePoint(
- final jalview.schemabinding.version2.SequencePoint vSequencePoint)
- {
- boolean removed = _sequencePointList.remove(vSequencePoint);
- return removed;
- }
-
- /**
- * Method removeSequencePointAt.
- *
- * @param index
- * @return the element removed from the collection
- */
- public jalview.schemabinding.version2.SequencePoint removeSequencePointAt(
- final int index)
- {
- java.lang.Object obj = this._sequencePointList.remove(index);
- return (jalview.schemabinding.version2.SequencePoint) obj;
- }
-
- /**
- *
- *
- * @param index
- * @param vAxis
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setAxis(final int index,
- final jalview.schemabinding.version2.Axis vAxis)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._axisList.size())
- {
- throw new IndexOutOfBoundsException("setAxis: Index value '" + index
- + "' not in range [0.." + (this._axisList.size() - 1) + "]");
- }
-
- this._axisList.set(index, vAxis);
- }
-
- /**
- *
- *
- * @param vAxisArray
- */
- public void setAxis(
- final jalview.schemabinding.version2.Axis[] vAxisArray)
- {
- // -- copy array
- _axisList.clear();
-
- for (int i = 0; i < vAxisArray.length; i++)
- {
- this._axisList.add(vAxisArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'bgColour'.
- *
- * @param bgColour
- * the value of field 'bgColour'.
- */
- public void setBgColour(final int bgColour)
- {
- this._bgColour = bgColour;
- this._has_bgColour = true;
- }
-
- /**
- * Sets the value of field 'denominateByShortestLength'.
- *
- * @param denominateByShortestLength
- * the value of field 'denominateByShortestLength'.
- */
- public void setDenominateByShortestLength(
- final boolean denominateByShortestLength)
- {
- this._denominateByShortestLength = denominateByShortestLength;
- this._has_denominateByShortestLength = true;
- }
-
- /**
- * Sets the value of field 'height'.
- *
- * @param height
- * the value of field 'height'.
- */
- public void setHeight(final int height)
- {
- this._height = height;
- this._has_height = true;
- }
-
- /**
- * Sets the value of field 'includeGappedColumns'.
- *
- * @param includeGappedColumns
- * the value of field 'includeGappedColumns'.
- */
- public void setIncludeGappedColumns(final boolean includeGappedColumns)
- {
- this._includeGappedColumns = includeGappedColumns;
- this._has_includeGappedColumns = true;
- }
-
- /**
- * Sets the value of field 'includeGaps'.
- *
- * @param includeGaps
- * the value of field 'includeGaps'.
- */
- public void setIncludeGaps(final boolean includeGaps)
- {
- this._includeGaps = includeGaps;
- this._has_includeGaps = true;
- }
-
- /**
- * Sets the value of field 'linkToAllViews'.
- *
- * @param linkToAllViews
- * the value of field 'linkToAllViews'.
- */
- public void setLinkToAllViews(final boolean linkToAllViews)
- {
- this._linkToAllViews = linkToAllViews;
- this._has_linkToAllViews = true;
- }
-
- /**
- * Sets the value of field 'matchGaps'.
- *
- * @param matchGaps
- * the value of field 'matchGaps'.
- */
- public void setMatchGaps(final boolean matchGaps)
- {
- this._matchGaps = matchGaps;
- this._has_matchGaps = true;
- }
-
- /**
- * Sets the value of field 'pcaData'.
- *
- * @param pcaData
- * the value of field 'pcaData'.
- */
- public void setPcaData(
- final jalview.schemabinding.version2.PcaData pcaData)
- {
- this._pcaData = pcaData;
- }
-
- /**
- * Sets the value of field 'scaleFactor'.
- *
- * @param scaleFactor
- * the value of field 'scaleFactor'.
- */
- public void setScaleFactor(final float scaleFactor)
- {
- this._scaleFactor = scaleFactor;
- this._has_scaleFactor = true;
- }
-
- /**
- * Sets the value of field 'scoreModelName'.
- *
- * @param scoreModelName
- * the value of field 'scoreModelName'.
- */
- public void setScoreModelName(final java.lang.String scoreModelName)
- {
- this._scoreModelName = scoreModelName;
- }
-
- /**
- * Sets the value of field 'seqPointMax'.
- *
- * @param seqPointMax
- * the value of field 'seqPointMax'.
- */
- public void setSeqPointMax(
- final jalview.schemabinding.version2.SeqPointMax seqPointMax)
- {
- this._seqPointMax = seqPointMax;
- }
-
- /**
- * Sets the value of field 'seqPointMin'.
- *
- * @param seqPointMin
- * the value of field 'seqPointMin'.
- */
- public void setSeqPointMin(
- final jalview.schemabinding.version2.SeqPointMin seqPointMin)
- {
- this._seqPointMin = seqPointMin;
- }
-
- /**
- *
- *
- * @param index
- * @param vSequencePoint
- * @throws java.lang.IndexOutOfBoundsException
- * if the index given is outside the bounds of the collection
- */
- public void setSequencePoint(final int index,
- final jalview.schemabinding.version2.SequencePoint vSequencePoint)
- throws java.lang.IndexOutOfBoundsException
- {
- // check bounds for index
- if (index < 0 || index >= this._sequencePointList.size())
- {
- throw new IndexOutOfBoundsException("setSequencePoint: Index value '"
- + index + "' not in range [0.."
- + (this._sequencePointList.size() - 1) + "]");
- }
-
- this._sequencePointList.set(index, vSequencePoint);
- }
-
- /**
- *
- *
- * @param vSequencePointArray
- */
- public void setSequencePoint(
- final jalview.schemabinding.version2.SequencePoint[] vSequencePointArray)
- {
- // -- copy array
- _sequencePointList.clear();
-
- for (int i = 0; i < vSequencePointArray.length; i++)
- {
- this._sequencePointList.add(vSequencePointArray[i]);
- }
- }
-
- /**
- * Sets the value of field 'showLabels'.
- *
- * @param showLabels
- * the value of field 'showLabels'.
- */
- public void setShowLabels(final boolean showLabels)
- {
- this._showLabels = showLabels;
- this._has_showLabels = true;
- }
-
- /**
- * Sets the value of field 'title'.
- *
- * @param title
- * the value of field 'title'.
- */
- public void setTitle(final java.lang.String title)
- {
- this._title = title;
- }
-
- /**
- * Sets the value of field 'width'.
- *
- * @param width
- * the value of field 'width'.
- */
- public void setWidth(final int width)
- {
- this._width = width;
- this._has_width = true;
- }
-
- /**
- * Sets the value of field 'xDim'.
- *
- * @param xDim
- * the value of field 'xDim'.
- */
- public void setXDim(final int xDim)
- {
- this._xDim = xDim;
- this._has_xDim = true;
- }
-
- /**
- * Sets the value of field 'xpos'.
- *
- * @param xpos
- * the value of field 'xpos'.
- */
- public void setXpos(final int xpos)
- {
- this._xpos = xpos;
- this._has_xpos = true;
- }
-
- /**
- * Sets the value of field 'yDim'.
- *
- * @param yDim
- * the value of field 'yDim'.
- */
- public void setYDim(final int yDim)
- {
- this._yDim = yDim;
- this._has_yDim = true;
- }
-
- /**
- * Sets the value of field 'ypos'.
- *
- * @param ypos
- * the value of field 'ypos'.
- */
- public void setYpos(final int ypos)
- {
- this._ypos = ypos;
- this._has_ypos = true;
- }
-
- /**
- * Sets the value of field 'zDim'.
- *
- * @param zDim
- * the value of field 'zDim'.
- */
- public void setZDim(final int zDim)
- {
- this._zDim = zDim;
- this._has_zDim = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.PcaViewer
- */
- public static jalview.schemabinding.version2.PcaViewer unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.PcaViewer) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.PcaViewer.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class Row.
- *
- * @version $Revision$ $Date$
- */
-public class Row extends DoubleVector implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public Row()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleVector
- */
- public static jalview.schemabinding.version2.DoubleVector unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleVector) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.Row.class, reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class SeqPointMax.
- *
- * @version $Revision$ $Date$
- */
-public class SeqPointMax implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _xPos.
- */
- private float _xPos;
-
- /**
- * keeps track of state for field: _xPos
- */
- private boolean _has_xPos;
-
- /**
- * Field _yPos.
- */
- private float _yPos;
-
- /**
- * keeps track of state for field: _yPos
- */
- private boolean _has_yPos;
-
- /**
- * Field _zPos.
- */
- private float _zPos;
-
- /**
- * keeps track of state for field: _zPos
- */
- private boolean _has_zPos;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SeqPointMax()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- */
- public void deleteXPos()
- {
- this._has_xPos = false;
- }
-
- /**
- */
- public void deleteYPos()
- {
- this._has_yPos = false;
- }
-
- /**
- */
- public void deleteZPos()
- {
- this._has_zPos = false;
- }
-
- /**
- * Returns the value of field 'xPos'.
- *
- * @return the value of field 'XPos'.
- */
- public float getXPos()
- {
- return this._xPos;
- }
-
- /**
- * Returns the value of field 'yPos'.
- *
- * @return the value of field 'YPos'.
- */
- public float getYPos()
- {
- return this._yPos;
- }
-
- /**
- * Returns the value of field 'zPos'.
- *
- * @return the value of field 'ZPos'.
- */
- public float getZPos()
- {
- return this._zPos;
- }
-
- /**
- * Method hasXPos.
- *
- * @return true if at least one XPos has been added
- */
- public boolean hasXPos()
- {
- return this._has_xPos;
- }
-
- /**
- * Method hasYPos.
- *
- * @return true if at least one YPos has been added
- */
- public boolean hasYPos()
- {
- return this._has_yPos;
- }
-
- /**
- * Method hasZPos.
- *
- * @return true if at least one ZPos has been added
- */
- public boolean hasZPos()
- {
- return this._has_zPos;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'xPos'.
- *
- * @param xPos
- * the value of field 'xPos'.
- */
- public void setXPos(final float xPos)
- {
- this._xPos = xPos;
- this._has_xPos = true;
- }
-
- /**
- * Sets the value of field 'yPos'.
- *
- * @param yPos
- * the value of field 'yPos'.
- */
- public void setYPos(final float yPos)
- {
- this._yPos = yPos;
- this._has_yPos = true;
- }
-
- /**
- * Sets the value of field 'zPos'.
- *
- * @param zPos
- * the value of field 'zPos'.
- */
- public void setZPos(final float zPos)
- {
- this._zPos = zPos;
- this._has_zPos = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.SeqPointMax
- */
- public static jalview.schemabinding.version2.SeqPointMax unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.SeqPointMax) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.SeqPointMax.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class SeqPointMin.
- *
- * @version $Revision$ $Date$
- */
-public class SeqPointMin implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _xPos.
- */
- private float _xPos;
-
- /**
- * keeps track of state for field: _xPos
- */
- private boolean _has_xPos;
-
- /**
- * Field _yPos.
- */
- private float _yPos;
-
- /**
- * keeps track of state for field: _yPos
- */
- private boolean _has_yPos;
-
- /**
- * Field _zPos.
- */
- private float _zPos;
-
- /**
- * keeps track of state for field: _zPos
- */
- private boolean _has_zPos;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SeqPointMin()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- */
- public void deleteXPos()
- {
- this._has_xPos = false;
- }
-
- /**
- */
- public void deleteYPos()
- {
- this._has_yPos = false;
- }
-
- /**
- */
- public void deleteZPos()
- {
- this._has_zPos = false;
- }
-
- /**
- * Returns the value of field 'xPos'.
- *
- * @return the value of field 'XPos'.
- */
- public float getXPos()
- {
- return this._xPos;
- }
-
- /**
- * Returns the value of field 'yPos'.
- *
- * @return the value of field 'YPos'.
- */
- public float getYPos()
- {
- return this._yPos;
- }
-
- /**
- * Returns the value of field 'zPos'.
- *
- * @return the value of field 'ZPos'.
- */
- public float getZPos()
- {
- return this._zPos;
- }
-
- /**
- * Method hasXPos.
- *
- * @return true if at least one XPos has been added
- */
- public boolean hasXPos()
- {
- return this._has_xPos;
- }
-
- /**
- * Method hasYPos.
- *
- * @return true if at least one YPos has been added
- */
- public boolean hasYPos()
- {
- return this._has_yPos;
- }
-
- /**
- * Method hasZPos.
- *
- * @return true if at least one ZPos has been added
- */
- public boolean hasZPos()
- {
- return this._has_zPos;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'xPos'.
- *
- * @param xPos
- * the value of field 'xPos'.
- */
- public void setXPos(final float xPos)
- {
- this._xPos = xPos;
- this._has_xPos = true;
- }
-
- /**
- * Sets the value of field 'yPos'.
- *
- * @param yPos
- * the value of field 'yPos'.
- */
- public void setYPos(final float yPos)
- {
- this._yPos = yPos;
- this._has_yPos = true;
- }
-
- /**
- * Sets the value of field 'zPos'.
- *
- * @param zPos
- * the value of field 'zPos'.
- */
- public void setZPos(final float zPos)
- {
- this._zPos = zPos;
- this._has_zPos = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.SeqPointMin
- */
- public static jalview.schemabinding.version2.SeqPointMin unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.SeqPointMin) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.SeqPointMin.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class SequencePoint.
- *
- * @version $Revision$ $Date$
- */
-public class SequencePoint implements java.io.Serializable
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _sequenceRef.
- */
- private java.lang.String _sequenceRef;
-
- /**
- * Field _xPos.
- */
- private float _xPos;
-
- /**
- * keeps track of state for field: _xPos
- */
- private boolean _has_xPos;
-
- /**
- * Field _yPos.
- */
- private float _yPos;
-
- /**
- * keeps track of state for field: _yPos
- */
- private boolean _has_yPos;
-
- /**
- * Field _zPos.
- */
- private float _zPos;
-
- /**
- * keeps track of state for field: _zPos
- */
- private boolean _has_zPos;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SequencePoint()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- */
- public void deleteXPos()
- {
- this._has_xPos = false;
- }
-
- /**
- */
- public void deleteYPos()
- {
- this._has_yPos = false;
- }
-
- /**
- */
- public void deleteZPos()
- {
- this._has_zPos = false;
- }
-
- /**
- * Returns the value of field 'sequenceRef'.
- *
- * @return the value of field 'SequenceRef'.
- */
- public java.lang.String getSequenceRef()
- {
- return this._sequenceRef;
- }
-
- /**
- * Returns the value of field 'xPos'.
- *
- * @return the value of field 'XPos'.
- */
- public float getXPos()
- {
- return this._xPos;
- }
-
- /**
- * Returns the value of field 'yPos'.
- *
- * @return the value of field 'YPos'.
- */
- public float getYPos()
- {
- return this._yPos;
- }
-
- /**
- * Returns the value of field 'zPos'.
- *
- * @return the value of field 'ZPos'.
- */
- public float getZPos()
- {
- return this._zPos;
- }
-
- /**
- * Method hasXPos.
- *
- * @return true if at least one XPos has been added
- */
- public boolean hasXPos()
- {
- return this._has_xPos;
- }
-
- /**
- * Method hasYPos.
- *
- * @return true if at least one YPos has been added
- */
- public boolean hasYPos()
- {
- return this._has_yPos;
- }
-
- /**
- * Method hasZPos.
- *
- * @return true if at least one ZPos has been added
- */
- public boolean hasZPos()
- {
- return this._has_zPos;
- }
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Sets the value of field 'sequenceRef'.
- *
- * @param sequenceRef
- * the value of field 'sequenceRef'.
- */
- public void setSequenceRef(final java.lang.String sequenceRef)
- {
- this._sequenceRef = sequenceRef;
- }
-
- /**
- * Sets the value of field 'xPos'.
- *
- * @param xPos
- * the value of field 'xPos'.
- */
- public void setXPos(final float xPos)
- {
- this._xPos = xPos;
- this._has_xPos = true;
- }
-
- /**
- * Sets the value of field 'yPos'.
- *
- * @param yPos
- * the value of field 'yPos'.
- */
- public void setYPos(final float yPos)
- {
- this._yPos = yPos;
- this._has_yPos = true;
- }
-
- /**
- * Sets the value of field 'zPos'.
- *
- * @param zPos
- * the value of field 'zPos'.
- */
- public void setZPos(final float zPos)
- {
- this._zPos = zPos;
- this._has_zPos = true;
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.SequencePoint
- */
- public static jalview.schemabinding.version2.SequencePoint unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.SequencePoint) Unmarshaller
- .unmarshal(jalview.schemabinding.version2.SequencePoint.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
-/**
- * Class TridiagonalMatrix.
- *
- * @version $Revision$ $Date$
- */
-public class TridiagonalMatrix extends DoubleMatrix
- implements java.io.Serializable
-{
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public TridiagonalMatrix()
- {
- super();
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method isValid.
- *
- * @return true if this object is valid according to the schema
- */
- public boolean isValid()
- {
- try
- {
- validate();
- } catch (org.exolab.castor.xml.ValidationException vex)
- {
- return false;
- }
- return true;
- }
-
- /**
- *
- *
- * @param out
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void marshal(final java.io.Writer out)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, out);
- }
-
- /**
- *
- *
- * @param handler
- * @throws java.io.IOException
- * if an IOException occurs during marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- */
- public void marshal(final org.xml.sax.ContentHandler handler)
- throws java.io.IOException,
- org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- Marshaller.marshal(this, handler);
- }
-
- /**
- * Method unmarshal.
- *
- * @param reader
- * @throws org.exolab.castor.xml.MarshalException
- * if object is null or if any SAXException is thrown during
- * marshaling
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- * @return the unmarshaled jalview.schemabinding.version2.DoubleMatrix
- */
- public static jalview.schemabinding.version2.DoubleMatrix unmarshal(
- final java.io.Reader reader)
- throws org.exolab.castor.xml.MarshalException,
- org.exolab.castor.xml.ValidationException
- {
- return (jalview.schemabinding.version2.DoubleMatrix) Unmarshaller
- .unmarshal(
- jalview.schemabinding.version2.TridiagonalMatrix.class,
- reader);
- }
-
- /**
- *
- *
- * @throws org.exolab.castor.xml.ValidationException
- * if this object is an invalid instance according to the schema
- */
- public void validate() throws org.exolab.castor.xml.ValidationException
- {
- org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
- validator.validate(this);
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.Axis;
-
-/**
- * Class AxisDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class AxisDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public AxisDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "axis";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _xPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_xPos", "xPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- Axis target = (Axis) object;
- if (!target.hasXPos())
- {
- return null;
- }
- return new java.lang.Float(target.getXPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- Axis target = (Axis) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXPos();
- return;
- }
- target.setXPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _yPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_yPos", "yPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- Axis target = (Axis) object;
- if (!target.hasYPos())
- {
- return null;
- }
- return new java.lang.Float(target.getYPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- Axis target = (Axis) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYPos();
- return;
- }
- target.setYPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _yPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _zPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_zPos", "zPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- Axis target = (Axis) object;
- if (!target.hasZPos())
- {
- return null;
- }
- return new java.lang.Float(target.getZPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- Axis target = (Axis) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteZPos();
- return;
- }
- target.setZPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _zPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.Axis.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.D;
-
-/**
- * Class DDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class DDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public DDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "D";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.D.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.DoubleMatrix;
-
-/**
- * Class DoubleMatrixDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class DoubleMatrixDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public DoubleMatrixDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "DoubleMatrix";
- _elementDefinition = false;
-
- // -- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _rows
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_rows", "rows",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleMatrix target = (DoubleMatrix) object;
- if (!target.hasRows())
- {
- return null;
- }
- return new java.lang.Integer(target.getRows());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteRows();
- return;
- }
- target.setRows(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _rows
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _columns
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_columns", "columns",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleMatrix target = (DoubleMatrix) object;
- if (!target.hasColumns())
- {
- return null;
- }
- return new java.lang.Integer(target.getColumns());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteColumns();
- return;
- }
- target.setColumns(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _columns
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- // -- _rowList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.Row.class, "_rowList", "row",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleMatrix target = (DoubleMatrix) object;
- return target.getRow();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- target.addRow((jalview.schemabinding.version2.Row) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- target.removeAllRow();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.Row();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _rowList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _d
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.D.class, "_d", "D",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleMatrix target = (DoubleMatrix) object;
- return target.getD();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- target.setD((jalview.schemabinding.version2.D) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.D();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _d
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _e
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.E.class, "_e", "E",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleMatrix target = (DoubleMatrix) object;
- return target.getE();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleMatrix target = (DoubleMatrix) object;
- target.setE((jalview.schemabinding.version2.E) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.E();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _e
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.DoubleMatrix.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.DoubleVector;
-
-/**
- * Class DoubleVectorDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class DoubleVectorDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public DoubleVectorDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "DoubleVector";
- _elementDefinition = false;
-
- // -- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- initialize element descriptors
-
- // -- _vList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Double.TYPE, "_vList", "v",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- DoubleVector target = (DoubleVector) object;
- return target.getV();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleVector target = (DoubleVector) object;
- // ignore null values for non optional primitives
- if (value == null)
- {
- return;
- }
-
- target.addV(((java.lang.Double) value).doubleValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- DoubleVector target = (DoubleVector) object;
- target.removeAllV();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _vList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(0);
- { // -- local scope
- org.exolab.castor.xml.validators.DoubleValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.DoubleValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-1.7976931348623157E308);
- typeValidator.setMaxInclusive(1.7976931348623157E308);
- }
- desc.setValidator(fieldValidator);
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.DoubleVector.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.E;
-
-/**
- * Class EDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class EDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public EDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "E";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.E.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.EigenMatrix;
-
-/**
- * Class EigenMatrixDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class EigenMatrixDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public EigenMatrixDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "eigenMatrix";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.EigenMatrix.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.PairwiseMatrix;
-
-/**
- * Class PairwiseMatrixDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class PairwiseMatrixDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PairwiseMatrixDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "pairwiseMatrix";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.PairwiseMatrix.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.PcaData;
-
-/**
- * Class PcaDataDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class PcaDataDescriptor extends
- jalview.schemabinding.version2.descriptors.PcaDataTypeDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaDataDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.PcaDataTypeDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "pcaData";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.PcaData.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.PcaDataType;
-
-/**
- * Class PcaDataTypeDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class PcaDataTypeDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaDataTypeDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "PcaDataType";
- _elementDefinition = false;
-
- // -- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- initialize element descriptors
-
- // -- _pairwiseMatrix
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.PairwiseMatrix.class,
- "_pairwiseMatrix", "pairwiseMatrix",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaDataType target = (PcaDataType) object;
- return target.getPairwiseMatrix();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaDataType target = (PcaDataType) object;
- target.setPairwiseMatrix(
- (jalview.schemabinding.version2.PairwiseMatrix) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.PairwiseMatrix();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _pairwiseMatrix
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _tridiagonalMatrix
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.TridiagonalMatrix.class,
- "_tridiagonalMatrix", "tridiagonalMatrix",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaDataType target = (PcaDataType) object;
- return target.getTridiagonalMatrix();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaDataType target = (PcaDataType) object;
- target.setTridiagonalMatrix(
- (jalview.schemabinding.version2.TridiagonalMatrix) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.TridiagonalMatrix();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _tridiagonalMatrix
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _eigenMatrix
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.EigenMatrix.class,
- "_eigenMatrix", "eigenMatrix",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaDataType target = (PcaDataType) object;
- return target.getEigenMatrix();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaDataType target = (PcaDataType) object;
- target.setEigenMatrix(
- (jalview.schemabinding.version2.EigenMatrix) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.EigenMatrix();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _eigenMatrix
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.PcaDataType.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.PcaViewer;
-
-/**
- * Class PcaViewerDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class PcaViewerDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public PcaViewerDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "PcaViewer";
- _elementDefinition = true;
-
- // -- set grouping compositor
- setCompositorAsSequence();
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _title
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_title", "title",
- org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getTitle();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.setTitle((java.lang.String) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _title
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- // -- _scoreModelName
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_scoreModelName", "scoreModelName",
- org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getScoreModelName();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.setScoreModelName((java.lang.String) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _scoreModelName
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- // -- _xDim
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_xDim", "xDim",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasXDim())
- {
- return null;
- }
- return new java.lang.Integer(target.getXDim());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXDim();
- return;
- }
- target.setXDim(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xDim
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _yDim
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_yDim", "yDim",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasYDim())
- {
- return null;
- }
- return new java.lang.Integer(target.getYDim());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYDim();
- return;
- }
- target.setYDim(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _yDim
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _zDim
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_zDim", "zDim",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasZDim())
- {
- return null;
- }
- return new java.lang.Integer(target.getZDim());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteZDim();
- return;
- }
- target.setZDim(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _zDim
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _bgColour
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_bgColour", "bgColour",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasBgColour())
- {
- return null;
- }
- return new java.lang.Integer(target.getBgColour());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteBgColour();
- return;
- }
- target.setBgColour(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _bgColour
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _scaleFactor
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_scaleFactor", "scaleFactor",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasScaleFactor())
- {
- return null;
- }
- return new java.lang.Float(target.getScaleFactor());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteScaleFactor();
- return;
- }
- target.setScaleFactor(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _scaleFactor
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _showLabels
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_showLabels", "showLabels",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasShowLabels())
- {
- return null;
- }
- return (target.getShowLabels() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteShowLabels();
- return;
- }
- target.setShowLabels(((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _showLabels
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _linkToAllViews
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_linkToAllViews", "linkToAllViews",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasLinkToAllViews())
- {
- return null;
- }
- return (target.getLinkToAllViews() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteLinkToAllViews();
- return;
- }
- target.setLinkToAllViews(
- ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _linkToAllViews
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _includeGaps
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_includeGaps", "includeGaps",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasIncludeGaps())
- {
- return null;
- }
- return (target.getIncludeGaps() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteIncludeGaps();
- return;
- }
- target.setIncludeGaps(((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _includeGaps
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _matchGaps
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_matchGaps", "matchGaps",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasMatchGaps())
- {
- return null;
- }
- return (target.getMatchGaps() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteMatchGaps();
- return;
- }
- target.setMatchGaps(((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _matchGaps
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _includeGappedColumns
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_includeGappedColumns",
- "includeGappedColumns",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasIncludeGappedColumns())
- {
- return null;
- }
- return (target.getIncludeGappedColumns() ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteIncludeGappedColumns();
- return;
- }
- target.setIncludeGappedColumns(
- ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _includeGappedColumns
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _denominateByShortestLength
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Boolean.TYPE, "_denominateByShortestLength",
- "denominateByShortestLength",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasDenominateByShortestLength())
- {
- return null;
- }
- return (target.getDenominateByShortestLength()
- ? java.lang.Boolean.TRUE
- : java.lang.Boolean.FALSE);
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteDenominateByShortestLength();
- return;
- }
- target.setDenominateByShortestLength(
- ((java.lang.Boolean) value).booleanValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _denominateByShortestLength
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.BooleanValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
- fieldValidator.setValidator(typeValidator);
- }
- desc.setValidator(fieldValidator);
- // -- _width
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_width", "width",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasWidth())
- {
- return null;
- }
- return new java.lang.Integer(target.getWidth());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteWidth();
- return;
- }
- target.setWidth(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _width
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _height
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_height", "height",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasHeight())
- {
- return null;
- }
- return new java.lang.Integer(target.getHeight());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteHeight();
- return;
- }
- target.setHeight(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _height
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _xpos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_xpos", "xpos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasXpos())
- {
- return null;
- }
- return new java.lang.Integer(target.getXpos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXpos();
- return;
- }
- target.setXpos(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xpos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- _ypos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Integer.TYPE, "_ypos", "ypos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- if (!target.hasYpos())
- {
- return null;
- }
- return new java.lang.Integer(target.getYpos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYpos();
- return;
- }
- target.setYpos(((java.lang.Integer) value).intValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _ypos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.IntValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.IntValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive(-2147483648);
- typeValidator.setMaxInclusive(2147483647);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- // -- _sequencePointList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.SequencePoint.class,
- "_sequencePointList", "sequencePoint",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getSequencePoint();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.addSequencePoint(
- (jalview.schemabinding.version2.SequencePoint) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.removeAllSequencePoint();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.SequencePoint();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _sequencePointList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _axisList
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.Axis.class, "_axisList", "axis",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getAxis();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.addAxis((jalview.schemabinding.version2.Axis) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public void resetValue(Object object)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.removeAllAxis();
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.Axis();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(true);
- addFieldDescriptor(desc);
-
- // -- validation code for: _axisList
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(3);
- fieldValidator.setMaxOccurs(3);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _seqPointMin
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.SeqPointMin.class,
- "_seqPointMin", "seqPointMin",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getSeqPointMin();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.setSeqPointMin(
- (jalview.schemabinding.version2.SeqPointMin) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.SeqPointMin();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _seqPointMin
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _seqPointMax
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.SeqPointMax.class,
- "_seqPointMax", "seqPointMax",
- org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getSeqPointMax();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.setSeqPointMax(
- (jalview.schemabinding.version2.SeqPointMax) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.SeqPointMax();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _seqPointMax
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- // -- _pcaData
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- jalview.schemabinding.version2.PcaData.class, "_pcaData",
- "pcaData", org.exolab.castor.xml.NodeType.Element);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- PcaViewer target = (PcaViewer) object;
- return target.getPcaData();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- PcaViewer target = (PcaViewer) object;
- target.setPcaData((jalview.schemabinding.version2.PcaData) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return new jalview.schemabinding.version2.PcaData();
- }
- };
- desc.setHandler(handler);
- desc.setNameSpaceURI("www.jalview.org");
- desc.setRequired(true);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _pcaData
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- fieldValidator.setMinOccurs(1);
- { // -- local scope
- }
- desc.setValidator(fieldValidator);
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.PcaViewer.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.Row;
-
-/**
- * Class RowDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class RowDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public RowDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleVectorDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "row";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.Row.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.SeqPointMax;
-
-/**
- * Class SeqPointMaxDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class SeqPointMaxDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SeqPointMaxDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "seqPointMax";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _xPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_xPos", "xPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMax target = (SeqPointMax) object;
- if (!target.hasXPos())
- {
- return null;
- }
- return new java.lang.Float(target.getXPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMax target = (SeqPointMax) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXPos();
- return;
- }
- target.setXPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _yPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_yPos", "yPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMax target = (SeqPointMax) object;
- if (!target.hasYPos())
- {
- return null;
- }
- return new java.lang.Float(target.getYPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMax target = (SeqPointMax) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYPos();
- return;
- }
- target.setYPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _yPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _zPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_zPos", "zPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMax target = (SeqPointMax) object;
- if (!target.hasZPos())
- {
- return null;
- }
- return new java.lang.Float(target.getZPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMax target = (SeqPointMax) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteZPos();
- return;
- }
- target.setZPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _zPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.SeqPointMax.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.SeqPointMin;
-
-/**
- * Class SeqPointMinDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class SeqPointMinDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SeqPointMinDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "seqPointMin";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _xPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_xPos", "xPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMin target = (SeqPointMin) object;
- if (!target.hasXPos())
- {
- return null;
- }
- return new java.lang.Float(target.getXPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMin target = (SeqPointMin) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXPos();
- return;
- }
- target.setXPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _yPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_yPos", "yPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMin target = (SeqPointMin) object;
- if (!target.hasYPos())
- {
- return null;
- }
- return new java.lang.Float(target.getYPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMin target = (SeqPointMin) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYPos();
- return;
- }
- target.setYPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _yPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _zPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_zPos", "zPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SeqPointMin target = (SeqPointMin) object;
- if (!target.hasZPos())
- {
- return null;
- }
- return new java.lang.Float(target.getZPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SeqPointMin target = (SeqPointMin) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteZPos();
- return;
- }
- target.setZPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _zPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.SeqPointMin.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.SequencePoint;
-
-/**
- * Class SequencePointDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class SequencePointDescriptor
- extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public SequencePointDescriptor()
- {
- super();
- _nsURI = "www.jalview.org";
- _xmlName = "sequencePoint";
- _elementDefinition = true;
- org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
- org.exolab.castor.mapping.FieldHandler handler = null;
- org.exolab.castor.xml.FieldValidator fieldValidator = null;
- // -- initialize attribute descriptors
-
- // -- _sequenceRef
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.String.class, "_sequenceRef", "sequenceRef",
- org.exolab.castor.xml.NodeType.Attribute);
- desc.setImmutable(true);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SequencePoint target = (SequencePoint) object;
- return target.getSequenceRef();
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SequencePoint target = (SequencePoint) object;
- target.setSequenceRef((java.lang.String) value);
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _sequenceRef
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.StringValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.StringValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setWhiteSpace("preserve");
- }
- desc.setValidator(fieldValidator);
- // -- _xPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_xPos", "xPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SequencePoint target = (SequencePoint) object;
- if (!target.hasXPos())
- {
- return null;
- }
- return new java.lang.Float(target.getXPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SequencePoint target = (SequencePoint) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteXPos();
- return;
- }
- target.setXPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _xPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _yPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_yPos", "yPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SequencePoint target = (SequencePoint) object;
- if (!target.hasYPos())
- {
- return null;
- }
- return new java.lang.Float(target.getYPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SequencePoint target = (SequencePoint) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteYPos();
- return;
- }
- target.setYPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _yPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- _zPos
- desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
- java.lang.Float.TYPE, "_zPos", "zPos",
- org.exolab.castor.xml.NodeType.Attribute);
- handler = new org.exolab.castor.xml.XMLFieldHandler()
- {
- public java.lang.Object getValue(java.lang.Object object)
- throws IllegalStateException
- {
- SequencePoint target = (SequencePoint) object;
- if (!target.hasZPos())
- {
- return null;
- }
- return new java.lang.Float(target.getZPos());
- }
-
- public void setValue(java.lang.Object object, java.lang.Object value)
- throws IllegalStateException, IllegalArgumentException
- {
- try
- {
- SequencePoint target = (SequencePoint) object;
- // if null, use delete method for optional primitives
- if (value == null)
- {
- target.deleteZPos();
- return;
- }
- target.setZPos(((java.lang.Float) value).floatValue());
- } catch (java.lang.Exception ex)
- {
- throw new IllegalStateException(ex.toString());
- }
- }
-
- public java.lang.Object newInstance(java.lang.Object parent)
- {
- return null;
- }
- };
- desc.setHandler(handler);
- desc.setMultivalued(false);
- addFieldDescriptor(desc);
-
- // -- validation code for: _zPos
- fieldValidator = new org.exolab.castor.xml.FieldValidator();
- { // -- local scope
- org.exolab.castor.xml.validators.FloatValidator typeValidator;
- typeValidator = new org.exolab.castor.xml.validators.FloatValidator();
- fieldValidator.setValidator(typeValidator);
- typeValidator.setMinInclusive((float) -3.4028235E38);
- typeValidator.setMaxInclusive((float) 3.4028235E38);
- }
- desc.setValidator(fieldValidator);
- // -- initialize element descriptors
-
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.SequencePoint.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
+++ /dev/null
-/*
- * This class was automatically generated with
- * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
- * Schema.
- * $Id$
- */
-
-package jalview.schemabinding.version2.descriptors;
-
-//---------------------------------/
-//- Imported classes and packages -/
-//---------------------------------/
-
-import jalview.schemabinding.version2.TridiagonalMatrix;
-
-/**
- * Class TridiagonalMatrixDescriptor.
- *
- * @version $Revision$ $Date$
- */
-public class TridiagonalMatrixDescriptor extends
- jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor
-{
-
- // --------------------------/
- // - Class/Member Variables -/
- // --------------------------/
-
- /**
- * Field _elementDefinition.
- */
- private boolean _elementDefinition;
-
- /**
- * Field _nsPrefix.
- */
- private java.lang.String _nsPrefix;
-
- /**
- * Field _nsURI.
- */
- private java.lang.String _nsURI;
-
- /**
- * Field _xmlName.
- */
- private java.lang.String _xmlName;
-
- // ----------------/
- // - Constructors -/
- // ----------------/
-
- public TridiagonalMatrixDescriptor()
- {
- super();
- setExtendsWithoutFlatten(
- new jalview.schemabinding.version2.descriptors.DoubleMatrixDescriptor());
- _nsURI = "www.jalview.org";
- _xmlName = "tridiagonalMatrix";
- _elementDefinition = true;
- }
-
- // -----------/
- // - Methods -/
- // -----------/
-
- /**
- * Method getAccessMode.
- *
- * @return the access mode specified for this class.
- */
- public org.exolab.castor.mapping.AccessMode getAccessMode()
- {
- return null;
- }
-
- /**
- * Method getIdentity.
- *
- * @return the identity field, null if this class has no identity.
- */
- public org.exolab.castor.mapping.FieldDescriptor getIdentity()
- {
- return super.getIdentity();
- }
-
- /**
- * Method getJavaClass.
- *
- * @return the Java class represented by this descriptor.
- */
- public java.lang.Class getJavaClass()
- {
- return jalview.schemabinding.version2.TridiagonalMatrix.class;
- }
-
- /**
- * Method getNameSpacePrefix.
- *
- * @return the namespace prefix to use when marshaling as XML.
- */
- public java.lang.String getNameSpacePrefix()
- {
- return _nsPrefix;
- }
-
- /**
- * Method getNameSpaceURI.
- *
- * @return the namespace URI used when marshaling and unmarshaling as XML.
- */
- public java.lang.String getNameSpaceURI()
- {
- return _nsURI;
- }
-
- /**
- * Method getValidator.
- *
- * @return a specific validator for the class described by this
- * ClassDescriptor.
- */
- public org.exolab.castor.xml.TypeValidator getValidator()
- {
- return this;
- }
-
- /**
- * Method getXMLName.
- *
- * @return the XML Name for the Class being described.
- */
- public java.lang.String getXMLName()
- {
- return _xmlName;
- }
-
- /**
- * Method isElementDefinition.
- *
- * @return true if XML schema definition of this Class is that of a global
- * element or element with anonymous type definition.
- */
- public boolean isElementDefinition()
- {
- return _elementDefinition;
- }
-
-}
}
}
- AlignmentI readAlignmentFile(File f)
+ protected AlignmentI readAlignmentFile(File f)
{
System.out.println("Reading file: " + f);
String ff = f.getPath();
--- /dev/null
+package jalview.io;
+
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.JvOptionPane;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class BackupFilesTest
+{
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ private static boolean actuallyDeleteTmpFiles = true;
+ private static String testDir = "examples";
+
+ private static String testBasename = "backupfilestest";
+
+ private static String testExt = ".fa";
+
+ private static String testFilename = testBasename + testExt;
+
+
+ private static String testFile = testDir + File.separatorChar
+ + testFilename;
+
+ private static String newBasename = testBasename + "Temp";
+
+ private static String newFilename = newBasename + testExt;
+
+ private static String newFile = testDir + File.separatorChar
+ + newFilename;
+
+ private static String sequenceName = "BACKUP_FILES";
+
+ private static String sequenceDescription = "backupfiles";
+
+ private static String sequenceData = "AAAARG";
+
+ private static String suffix = "_BACKUPTEST-%n";
+
+ private static int digits = 8;
+
+ private static int rollMax = 2;
+
+ private AlignFrame af;
+
+ // read and save with backupfiles disabled
+ @Test(groups = { "Functional" })
+ public void noBackupsEnabledTest() throws Exception
+ {
+ // set BACKUPFILES_ENABLED to false (i.e. turn off BackupFiles feature -- no
+ // backup files to be made when saving)
+ setBackupFilesOptions(false, true, true);
+
+ // init the newFile and backups (i.e. make sure newFile exists on its own
+ // and has no backups
+ initNewFileForTesting();
+
+ // now save again
+ save();
+
+ // check no backup files
+ File[] backupFiles = getBackupFiles();
+ Assert.assertTrue(backupFiles.length == 0);
+ }
+
+ // save keeping all backup files
+ @Test(groups = { "Functional" })
+ public void backupsEnabledNoRollMaxTest() throws Exception
+ {
+ // Enable BackupFiles and set noMax so all backupfiles get kept
+ setBackupFilesOptions(true, false, true);
+
+ // init the newFile and backups (i.e. make sure newFile exists on its own
+ // and has no backups)
+ initNewFileForTesting();
+
+ // now save a few times again. No rollMax so should have more than two
+ // backup files
+ int numSaves = 10;
+ for (int i = 0; i < numSaves; i++)
+ {
+ save();
+ }
+
+ // check 10 backup files
+ HashMap correctindexmap = new HashMap();
+ correctindexmap.put(1, "backupfilestestTemp_BACKUPTEST-00000001.fa");
+ correctindexmap.put(2, "backupfilestestTemp_BACKUPTEST-00000002.fa");
+ correctindexmap.put(3, "backupfilestestTemp_BACKUPTEST-00000003.fa");
+ correctindexmap.put(4, "backupfilestestTemp_BACKUPTEST-00000004.fa");
+ correctindexmap.put(5, "backupfilestestTemp_BACKUPTEST-00000005.fa");
+ correctindexmap.put(6, "backupfilestestTemp_BACKUPTEST-00000006.fa");
+ correctindexmap.put(7, "backupfilestestTemp_BACKUPTEST-00000007.fa");
+ correctindexmap.put(8, "backupfilestestTemp_BACKUPTEST-00000008.fa");
+ correctindexmap.put(9, "backupfilestestTemp_BACKUPTEST-00000009.fa");
+ correctindexmap.put(10, "backupfilestestTemp_BACKUPTEST-00000010.fa");
+ HashMap wrongindexmap = new HashMap();
+ wrongindexmap.put(1, "backupfilestestTemp_BACKUPTEST-1.fa");
+ wrongindexmap.put(2, "backupfilestestTemp_BACKUPTEST-00000002.fa");
+ wrongindexmap.put(3, "backupfilestestTemp_BACKUPTEST-00000003.fa");
+ wrongindexmap.put(4, "backupfilestestTemp_BACKUPTEST-00000004.fa");
+ wrongindexmap.put(5, "backupfilestestTemp_BACKUPTEST-00000005.fa");
+ wrongindexmap.put(6, "backupfilestestTemp_BACKUPTEST-00000006.fa");
+ wrongindexmap.put(7, "backupfilestestTemp_BACKUPTEST-00000007.fa");
+ wrongindexmap.put(8, "backupfilestestTemp_BACKUPTEST-00000008.fa");
+ wrongindexmap.put(9, "backupfilestestTemp_BACKUPTEST-00000009.fa");
+ wrongindexmap.put(10, "backupfilestestTemp_BACKUPTEST-00000010.fa");
+ int[] indexes2 = { 3, 4, 5, 6, 7, 8, 9, 10 };
+ int[] indexes3 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
+ Assert.assertTrue(checkBackupFiles(correctindexmap));
+ Assert.assertFalse(checkBackupFiles(wrongindexmap));
+ Assert.assertFalse(checkBackupFiles(indexes2));
+ Assert.assertFalse(checkBackupFiles(indexes3));
+ }
+
+ // save keeping only the last rollMax (2) backup files
+ @Test(groups = { "Functional" })
+ public void backupsEnabledRollMaxTest() throws Exception
+ {
+ // Enable BackupFiles and set noMax so all backupfiles get kept
+ setBackupFilesOptions(true, false, false);
+
+ // init the newFile and backups (i.e. make sure newFile exists on its own
+ // and has no backups)
+ initNewFileForTesting();
+
+ // now save a few times again. No rollMax so should have more than two
+ // backup files
+ int numSaves = 10;
+ for (int i = 0; i < numSaves; i++)
+ {
+ save();
+ }
+
+ // check there are "rollMax" backup files and they are all saved correctly
+ // check 10 backup files
+ HashMap correctindexmap = new HashMap();
+ correctindexmap.put(9, "backupfilestestTemp_BACKUPTEST-00000009.fa");
+ correctindexmap.put(10, "backupfilestestTemp_BACKUPTEST-00000010.fa");
+ int[] indexes2 = { 10 };
+ int[] indexes3 = { 8, 9, 10 };
+ Assert.assertTrue(checkBackupFiles(correctindexmap));
+ Assert.assertFalse(checkBackupFiles(indexes2));
+ Assert.assertFalse(checkBackupFiles(indexes3));
+ }
+
+ // save keeping only the last rollMax (2) backup files
+ @Test(groups = { "Functional" })
+ public void backupsEnabledReverseRollMaxTest() throws Exception
+ {
+ // Enable BackupFiles and set noMax so all backupfiles get kept
+ setBackupFilesOptions(true, true, false);
+
+ // init the newFile and backups (i.e. make sure newFile exists on its own
+ // and has no backups)
+ initNewFileForTesting();
+
+ // now save a few times again. No rollMax so should have more than two
+ // backup files
+ int numSaves = 10;
+ for (int i = 0; i < numSaves; i++)
+ {
+ save();
+ }
+
+ // check there are "rollMax" backup files and they are all saved correctly
+ // check 10 backup files
+ HashMap correctindexmap = new HashMap();
+ correctindexmap.put(1, "backupfilestestTemp_BACKUPTEST-00000001.fa");
+ correctindexmap.put(2, "backupfilestestTemp_BACKUPTEST-00000002.fa");
+ int[] indexes2 = { 1 };
+ int[] indexes3 = { 1, 2, 3 };
+ Assert.assertTrue(checkBackupFiles(correctindexmap));
+ Assert.assertFalse(checkBackupFiles(indexes2));
+ Assert.assertFalse(checkBackupFiles(indexes3));
+ }
+
+ private void setBackupFilesOptions()
+ {
+ setBackupFilesOptions(true, false, false);
+ }
+
+ private void setBackupFilesOptions(boolean enabled, boolean reverse,
+ boolean noMax)
+ {
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+
+ Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+ Boolean.toString(enabled));
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX, suffix);
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX_DIGITS,
+ Integer.toString(digits));
+ Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
+ Boolean.toString(reverse));
+ Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
+ Boolean.toString(noMax));
+ Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
+ Integer.toString(rollMax));
+ Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
+ "false");
+ }
+
+ private void save()
+ {
+ if (af != null)
+ {
+ af.saveAlignment(newFile, jalview.io.FileFormat.Fasta);
+ }
+ }
+
+ // this runs cleanTmpFiles and then writes the newFile once as a starting
+ // point for all tests
+ private void initNewFileForTesting() throws Exception
+ {
+ cleanupTmpFiles();
+
+ AppletFormatAdapter afa = new AppletFormatAdapter();
+ AlignmentI al = afa.readFile(testFile, DataSourceType.FILE,
+ jalview.io.FileFormat.Fasta);
+ List<SequenceI> l = al.getSequences();
+
+ // check this is right
+ if (l.size() != 1)
+ {
+ throw new Exception("single sequence from '" + testFile
+ + "' not read in correctly (should be a single short sequence). List<SequenceI> size is wrong.");
+ }
+ SequenceI s = l.get(0);
+ Sequence ref = new Sequence(sequenceName, sequenceData);
+ ref.setDescription(sequenceDescription);
+ if (!sequencesEqual(s, ref))
+ {
+ throw new Exception("single sequence from '" + testFile
+ + "' not read in correctly (should be a single short sequence). SequenceI name, description or data is wrong.");
+ }
+ // save alignment file to new filename -- this doesn't test backups disabled
+ // yet as this file shouldn't already exist
+ af = new AlignFrame(al, 0, 0);
+ af.saveAlignment(newFile, jalview.io.FileFormat.Fasta);
+ }
+
+ // this deletes the newFile (if it exists) and any saved backup file for it
+ @AfterClass(alwaysRun = true)
+ private void cleanupTmpFiles()
+ {
+ File newfile = new File(newFile);
+ if (newfile.exists())
+ {
+ newfile.delete();
+ }
+ File[] tmpFiles = getBackupFiles(newFile, suffix, digits);
+ for (int i = 0; i < tmpFiles.length; i++)
+ {
+ if (actuallyDeleteTmpFiles)
+ {
+ tmpFiles[i].delete();
+ }
+ else
+ {
+ System.out.println("Pretending to delete " + tmpFiles[i].getPath());
+ }
+ }
+ }
+
+ private static File[] getBackupFiles(String f, String s, int i)
+ {
+ TreeMap<Integer, File> bfTreeMap = BackupFiles.getBackupFilesAsTreeMap(f,
+ s, i);
+ File[] backupFiles = new File[bfTreeMap.size()];
+ bfTreeMap.values().toArray(backupFiles);
+ return backupFiles;
+ }
+
+ private static File[] getBackupFiles()
+ {
+ return getBackupFiles(newFile, suffix, digits);
+ }
+
+ private static boolean checkBackupFiles(HashMap<Integer, String> indexmap)
+ throws IOException
+ {
+ TreeMap<Integer, File> map = BackupFiles.getBackupFilesAsTreeMap(newFile,
+ suffix, digits);
+ Enumeration<Integer> indexesenum = Collections
+ .enumeration(indexmap.keySet());
+ while (indexesenum.hasMoreElements())
+ {
+ int i = indexesenum.nextElement();
+ String indexfilename = indexmap.get(i);
+ if (!map.containsKey(i))
+ {
+ return false;
+ }
+ File f = map.get(i);
+ if (!filesContentEqual(newFile, f.getPath()))
+ {
+ return false;
+ }
+ map.remove(i);
+ if (f == null)
+ {
+ return false;
+ }
+ if (!f.getName().equals(indexfilename))
+ {
+ return false;
+ }
+ }
+ // should be nothing left in map
+ if (map.size() > 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static boolean checkBackupFiles(int[] indexes) throws IOException
+ {
+ TreeMap<Integer, File> map = BackupFiles.getBackupFilesAsTreeMap(newFile,
+ suffix, digits);
+ for (int m = 0; m < indexes.length; m++)
+ {
+ int i = indexes[m];
+ if (!map.containsKey(i))
+ {
+ return false;
+ }
+ File f = map.get(i);
+ if (!filesContentEqual(newFile, f.getPath()))
+ {
+ return false;
+ }
+ map.remove(i);
+ if (f == null)
+ {
+ return false;
+ }
+ // check the filename -- although this uses the same code to forumulate the filename so not much of a test!
+ String filename = BackupFilenameFilter.getBackupFilename(i,
+ newBasename, suffix, digits, testExt);
+ if (!filename.equals(f.getName()))
+ {
+ System.out.println("Supposed filename '" + filename
+ + "' not equal to actual filename '" + f.getName() + "'");
+ return false;
+ }
+ }
+ // should be nothing left in map
+ if (map.size() > 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static String[] getBackupFilesAsStrings()
+ {
+ File[] files = getBackupFiles(newFile, suffix, digits);
+ String[] filenames = new String[files.length];
+ for (int i = 0; i < files.length; i++)
+ {
+ filenames[i] = files[i].getPath();
+ }
+ return filenames;
+ }
+
+ public static boolean sequencesEqual(SequenceI s1, SequenceI s2) {
+ if (s1 == null && s2 == null) {
+ return true;
+ } else if (s1 == null || s2 == null) {
+ return false;
+ }
+ return (s1.getName().equals(s2.getName())
+ && s1.getDescription().equals(s2.getDescription())
+ && Arrays.equals(s1.getSequence(), s2.getSequence()));
+ }
+
+ public static boolean filesContentEqual(String fileName1,
+ String fileName2) throws IOException
+ {
+ Path file1 = Paths.get(fileName1);
+ Path file2 = Paths.get(fileName2);
+ byte[] bytes1 = Files.readAllBytes(file1);
+ byte[] bytes2 = Files.readAllBytes(file2);
+ return Arrays.equals(bytes1, bytes2);
+ }
+
+}
#---JalviewX Properties File---
#Fri Apr 25 09:54:25 BST 2014
+#
+BACKUPFILES_ROLL_MAX=2
+BACKUPFILES_REVERSE_ORDER=false
+BACKUPFILES_SUFFIX=_BACKUPFILESTESTTMP%n
+BACKUPFILES_CONFIRM_DELETE_OLD=false
+BACKUPFILES_NO_MAX=false
+BACKUPFILES_ENABLED=true
+BACKUPFILES_SUFFIX_DIGITS=8
SCREEN_Y=768
SCREEN_X=936
SHOW_WSDISCOVERY_ERRORS=true