
repicea.simulation.treelogger.TreeLoggerParameters Maven / Gradle / Ivy
/*
* This file is part of the repicea-simulation library.
*
* Copyright (C) 2009-2012 Mathieu Fortin for Rouge-Epicea
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed with the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* Please see the license at http://www.gnu.org/copyleft/lesser.html.
*/
package repicea.simulation.treelogger;
import java.awt.Container;
import java.awt.Window;
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.lang.instrument.IllegalClassFormatException;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.swing.filechooser.FileFilter;
import repicea.gui.REpiceaShowableUIWithParent;
import repicea.gui.permissions.DefaultREpiceaGUIPermission;
import repicea.gui.permissions.REpiceaGUIPermission;
import repicea.gui.permissions.REpiceaGUIPermissionProvider;
import repicea.io.IOUserInterfaceableObject;
import repicea.serial.Memorizable;
import repicea.serial.MemorizerPackage;
import repicea.serial.xml.PostXmlUnmarshalling;
import repicea.serial.xml.XmlDeserializer;
import repicea.serial.xml.XmlMarshallException;
import repicea.serial.xml.XmlMarshallingUtilities;
import repicea.serial.xml.XmlSerializer;
import repicea.simulation.treelogger.TreeLoggerParametersDialog.MessageID;
import repicea.util.ExtendedFileFilter;
/**
* The TreeLoggerParameters contains the basic features for defining the
* parameters of a treelogger.
* @param a TreeLogCategory-derived class
* @author M. Fortin - August 2010
*/
@SuppressWarnings("serial")
public abstract class TreeLoggerParameters implements Memorizable,
IOUserInterfaceableObject,
Serializable,
REpiceaShowableUIWithParent,
PostXmlUnmarshalling,
REpiceaGUIPermissionProvider {
protected static class TreeLoggerParametersFileFilter extends FileFilter implements ExtendedFileFilter {
private String extension = ".tlp";
@Override
public boolean accept(File file) {
if (file.isDirectory()) {
return true;
} else {
return file.getPath().toLowerCase().endsWith(getExtension());
}
}
@Override
public String getDescription() {
return MessageID.TreeLoggerParametersFileExtension.toString();
}
@Override
public String getExtension() {return extension;}
}
protected final static TreeLoggerParametersFileFilter TreeLoggerFileFilter = new TreeLoggerParametersFileFilter();
public static final String ANY_SPECIES = "ANY";
protected transient TreeLogger,?> treeLogger; // MF20140207 changed to transient to avoid serializing when users save the parameters
private String treeLoggerClass;
private final Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy