use of com.sldeditor.common.preferences.PrefData in project sldeditor by robward-scisys.
the class PrefPanelTest method testShowDialog.
/**
* Test method for
* {@link com.sldeditor.ui.preferences.PrefPanel#showDialog(com.sldeditor.common.preferences.PrefData)}.
*/
@Test
public void testShowDialog() {
TestPrefPanel panel = new TestPrefPanel();
panel.testPopulate(null);
PrefManager.destroyInstance();
PrefData prefData = PrefManager.getInstance().getPrefData();
prefData.setUiLayoutClass("com.sldeditor.ui.layout.SLDEditorDefaultLayout");
panel.testPopulate(prefData);
PrefData actual = panel.getPrefData();
assertTrue(prefData.equals(actual));
}
use of com.sldeditor.common.preferences.PrefData 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)));
}
}
}
use of com.sldeditor.common.preferences.PrefData in project sldeditor by robward-scisys.
the class PrefPanel method getPrefData.
/**
* Get preference data.
*
* @return the preference data
*/
public PrefData getPrefData() {
PrefData prefData = new PrefData();
prefData.setCheckAppVersionOnStartUp(chckbxCheckAppVersionOnStartUp.isSelected());
prefData.setUseAntiAlias(chckbxUseAntiAlias.isSelected());
prefData.setVendorOptionVersionList(model.getVendorOptionVersionList());
String uiLayoutClass = uiLayoutMap.get(uiLayoutComboBox.getSelectedItem());
prefData.setUiLayoutClass(uiLayoutClass);
prefData.setSaveLastFolderView(chckbxSetSaveLastFolderViewed.isSelected());
return prefData;
}
use of com.sldeditor.common.preferences.PrefData in project sldeditor by robward-scisys.
the class PrefDataTest method testSaveLastFolderView.
/**
* Test method for {@link com.sldeditor.common.preferences.PrefData#getSaveLastFolderView()}.
* Test method for {@link com.sldeditor.common.preferences.PrefData#setSaveLastFolderView(boolean)}.
*/
@Test
public void testSaveLastFolderView() {
PrefData prefData = new PrefData();
boolean expectedValue = true;
prefData.setSaveLastFolderView(expectedValue);
assertEquals(expectedValue, prefData.isSaveLastFolderView());
expectedValue = false;
prefData.setSaveLastFolderView(expectedValue);
assertEquals(expectedValue, prefData.isSaveLastFolderView());
}
use of com.sldeditor.common.preferences.PrefData in project sldeditor by robward-scisys.
the class PrefDataTest method testUseAntiAlias.
/**
* Test method for {@link com.sldeditor.common.preferences.PrefData#isUseAntiAlias()}.
*/
@Test
public void testUseAntiAlias() {
PrefData prefData = new PrefData();
prefData.setUseAntiAlias(true);
assertTrue(prefData.isUseAntiAlias());
prefData.setUseAntiAlias(false);
assertFalse(prefData.isUseAntiAlias());
}
Aggregations