use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class RenderTransformationDialog method main.
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
GeoServerConnectionManagerInterface dummyInterface = new GeoServerConnectionManagerInterface() {
@Override
public List<GeoServerConnection> getConnectionList() {
List<GeoServerConnection> list = new ArrayList<GeoServerConnection>();
GeoServerConnection connection = new GeoServerConnection();
connection.setConnectionName("Test");
try {
connection.setUrl(new URL("http://localhost:8080/geoserver"));
connection.setUserName("admin");
connection.setPassword("geoserver");
list.add(connection);
} catch (MalformedURLException e) {
e.printStackTrace();
}
return list;
}
@Override
public void updateList() {
}
@Override
public GeoServerConnection getConnection(String connectionDataName) {
return null;
}
@Override
public void readPropertyFile(GeoServerReadProgress progress) {
}
@Override
public Map<GeoServerConnection, GeoServerClientInterface> getConnectionMap() {
return null;
}
@Override
public void removeConnection(GeoServerConnection connection) {
}
@Override
public void addNewConnection(GeoServerReadProgress progress, GeoServerConnection newConnectionDetails) {
}
};
List<VersionData> vendorOptionList = new ArrayList<VersionData>();
vendorOptionList.add(VersionData.getLatestVersion(GeoServerVendorOption.class));
VendorOptionManager.getInstance().setSelectedVendorOptions(vendorOptionList);
RenderTransformationDialog dlg = new RenderTransformationDialog(dummyInterface);
dlg.showDialog(null);
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class CheckUpdate method shouldUpdate.
/**
* Should update.
*
* @param currentVersion the current version
* @return true, if successful
*/
public boolean shouldUpdate(String currentVersion) {
if (client != null) {
latestData = client.getLatest();
if (latestData != null) {
VersionData current = VersionData.decode(latestData.getVersion().getVendorOptionType(), currentVersion);
int result = current.compareTo(latestData.getVersion());
return (result == -1);
}
}
return false;
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class PrefDataTest method testVendorOptionVersionList.
/**
* Test method for {@link com.sldeditor.common.preferences.PrefData#getVendorOptionVersionList()}.
* Test method for {@link com.sldeditor.common.preferences.PrefData#setVendorOptionVersionList()}.
*/
@Test
public void testVendorOptionVersionList() {
PrefData prefData = new PrefData();
List<VersionData> vendorOptionList = new ArrayList<VersionData>();
vendorOptionList.add(VendorOptionManager.getInstance().getDefaultVendorOptionVersionData());
prefData.setVendorOptionVersionList(vendorOptionList);
assertEquals(vendorOptionList, prefData.getVendorOptionVersionList());
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class PrefDataTest method testClone.
/**
* Test method for {@link com.sldeditor.common.preferences.PrefData#clone()}.
*/
@Test
public void testClone() {
PrefData prefData = new PrefData();
prefData.setUseAntiAlias(true);
List<VersionData> vendorOptionList = new ArrayList<VersionData>();
vendorOptionList.add(VendorOptionManager.getInstance().getDefaultVendorOptionVersionData());
prefData.setVendorOptionVersionList(vendorOptionList);
String uiLayoutClass = "perfect curve";
prefData.setUiLayoutClass(uiLayoutClass);
prefData.setLastFolderViewed("last folder");
PrefData newObj = prefData.clone();
assertEquals(newObj.getBackgroundColour(), prefData.getBackgroundColour());
assertEquals(newObj.getUiLayoutClass(), prefData.getUiLayoutClass());
assertEquals(newObj.getVendorOptionVersionList(), prefData.getVendorOptionVersionList());
assertEquals(newObj.isUseAntiAlias(), prefData.isUseAntiAlias());
assertEquals(newObj.isSaveLastFolderView(), prefData.isSaveLastFolderView());
assertEquals(newObj.getLastViewedKey(), prefData.getLastViewedKey());
assertEquals(newObj.getLastFolderViewed(), prefData.getLastFolderViewed());
assertEquals(newObj.isCheckAppVersionOnStartUp(), prefData.isCheckAppVersionOnStartUp());
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class SLDEditorFileTest method testVendorOptionsUpdated.
/**
* Test method for {@link com.sldeditor.datasource.SLDEditorFile#vendorOptionsUpdated()}.
*/
@Test
public void testVendorOptionsUpdated() {
SLDEditorFile.destroyInstance();
DummyDataUpdate dataUpdateListener = new DummyDataUpdate();
SLDEditorFile.getInstance().addSLDEditorFileUpdateListener(dataUpdateListener);
assertFalse(dataUpdateListener.dataEditedFlag);
SLDEditorFile.getInstance().vendorOptionsUpdated(null);
assertFalse(dataUpdateListener.dataEditedFlag);
List<VersionData> vendorOptionVersionsList = new ArrayList<VersionData>();
SLDEditorFile.getInstance().vendorOptionsUpdated(vendorOptionVersionsList);
assertFalse(dataUpdateListener.dataEditedFlag);
StyleWrapper styleWrapper = new StyleWrapper("workspace", "style");
SLDData sldData = new SLDData(styleWrapper, "contents");
SLDEditorFile.getInstance().setSLDData(sldData);
SLDEditorFile.getInstance().vendorOptionsUpdated(vendorOptionVersionsList);
assertTrue(dataUpdateListener.dataEditedFlag);
}
Aggregations