use of com.sldeditor.common.data.GeoServerLayer in project sldeditor by robward-scisys.
the class GeoServerReadProgress method populateLayers.
/**
* Populate layers.
*
* @param connection the connection
* @param geoServerNode the geo server node
*/
private void populateLayers(GeoServerConnection connection, GeoServerNode geoServerNode) {
removeNode(geoServerNode, LAYERS_NODE_TITLE);
GeoServerLayerHeadingNode layersNode = new GeoServerLayerHeadingNode(this.handler, connection, LAYERS_NODE_TITLE);
geoServerNode.add(layersNode);
Map<String, List<GeoServerLayer>> layerMap = geoServerLayerMap.get(connection);
for (String workspaceName : layerMap.keySet()) {
List<GeoServerLayer> layerList = layerMap.get(workspaceName);
GeoServerWorkspaceNode workspaceNode = new GeoServerWorkspaceNode(this.handler, connection, workspaceName, false);
// It is key to invoke this on the TreeModel, and NOT DefaultMutableTreeNode
treeModel.insertNodeInto(workspaceNode, layersNode, layersNode.getChildCount());
for (GeoServerLayer layer : layerList) {
GeoServerLayerNode childNode = new GeoServerLayerNode(this.handler, layer);
// It is key to invoke this on the TreeModel, and NOT DefaultMutableTreeNode
treeModel.insertNodeInto(childNode, workspaceNode, workspaceNode.getChildCount());
}
}
}
use of com.sldeditor.common.data.GeoServerLayer in project sldeditor by robward-scisys.
the class GeoServerLayerTest method testGeoServerLayer.
/**
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#GeoServerLayer()}.
*/
@Test
public void testGeoServerLayer() {
String layerWorkspace = "workspace";
String layerName = "layer";
GeoServerLayer layer = new GeoServerLayer(layerWorkspace, layerName);
assertTrue(layer.getLayerWorkspace().compareTo(layerWorkspace) == 0);
assertTrue(layer.getLayerName().compareTo(layerName) == 0);
}
use of com.sldeditor.common.data.GeoServerLayer in project sldeditor by robward-scisys.
the class GeoServerLayerTest method testGetStyleString.
/**
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#getStyleString()}.
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#setDefaultWorkspaceName(java.lang.String)}.
*/
@Test
public void testGetStyleString() {
GeoServerLayer.setDefaultWorkspaceName(null);
StyleWrapper styleWrapper = new StyleWrapper();
String style = "style";
styleWrapper.setStyle(style);
String workspace = "workspace";
styleWrapper.setWorkspace(workspace);
GeoServerLayer layer = new GeoServerLayer();
layer.setStyle(styleWrapper);
String styleString = layer.getStyleString();
assertTrue(style.compareTo(styleString) == 0);
String defaultWorkspaceName = "Default workspace";
styleWrapper.setWorkspace(defaultWorkspaceName);
layer.setStyle(styleWrapper);
GeoServerLayer.setDefaultWorkspaceName(defaultWorkspaceName);
String styleString2 = layer.getStyleString();
assertTrue(style.compareTo(styleString2) == 0);
styleWrapper.setWorkspace(workspace);
layer.setStyle(styleWrapper);
String styleString3 = layer.getStyleString();
assertEquals(styleString3.compareTo(workspace + ":" + style), 0);
}
use of com.sldeditor.common.data.GeoServerLayer in project sldeditor by robward-scisys.
the class GeoServerLayerTest method testGetLayerWorkspace.
/**
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#getLayerWorkspace()}.
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#setLayerWorkspace(java.lang.String)}.
*/
@Test
public void testGetLayerWorkspace() {
String layerWorkspace = "test workspace";
GeoServerLayer layer = new GeoServerLayer();
layer.setLayerWorkspace(layerWorkspace);
assertEquals(layer.getLayerWorkspace(), layerWorkspace);
}
use of com.sldeditor.common.data.GeoServerLayer in project sldeditor by robward-scisys.
the class GeoServerLayerTest method testGetLayerName.
/**
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#getLayerName()}.
* Test method for {@link com.sldeditor.common.data.GeoServerLayer#setLayerName(java.lang.String)}.
*/
@Test
public void testGetLayerName() {
String layerName = "test layer";
GeoServerLayer layer = new GeoServerLayer();
layer.setLayerName(layerName);
assertEquals(layer.getLayerName(), layerName);
}
Aggregations