use of com.sldeditor.common.vendoroption.minversion.MinimumVersion in project sldeditor by robward-scisys.
the class VendorOptionManager method loadSLDFile.
/**
* Load SLD file.
*
* @param uiMgr the ui mgr
* @param sld the sld
* @param sldData the sld data
*/
public void loadSLDFile(GetMinimumVersionInterface uiMgr, StyledLayerDescriptor sld, SLDDataInterface sldData) {
if (sldData != null) {
List<VersionData> selectedVendorOptionVersion = null;
String messageString = null;
if (sldData.getSldEditorFile() == null) {
MinimumVersion minimumVersion = new MinimumVersion(uiMgr);
minimumVersion.findMinimumVersion(sld);
// Find out what the default is
PrefData prefData = PrefManager.getInstance().getPrefData();
selectedVendorOptionVersion = minimumVersion.getMinimumVersion(prefData.getVendorOptionVersionList());
messageString = Localisation.getString(VendorOptionManager.class, "VendorOptionManager.loadedFromFile");
} else {
selectedVendorOptionVersion = sldData.getVendorOptionList();
messageString = Localisation.getString(VendorOptionManager.class, "VendorOptionManager.loadedFromSLDEditorFile");
}
if (selectedVendorOptionVersion != null) {
setSelectedVendorOptions(selectedVendorOptionVersion);
List<VersionData> listCopy = new ArrayList<>(selectedVendorOptionVersion);
Collections.sort(listCopy);
VersionData versionData = listCopy.get(listCopy.size() - 1);
ConsoleManager.getInstance().information(this, String.format("%s : %s", messageString, VendorOptionStatus.getVersionString(versionData)));
}
}
}
Aggregations