@Test public void testAddWmsWithExistingServerNode() throws Exception { WmsRootNode classUnderTest = new WmsRootNode(); WmsServerNode serverNode = new WmsServerNode("dummyServer", null, true, URLUtil.fromString("http: classUnderTest.addChild(serverNode); WMSLayerInfo layer = createWmsLayerInfo(); WmsLayerNode layerNode = classUnderTest.addWmsLayer(layer); assertEquals(1, classUnderTest.getChildCount()); assertEquals(serverNode, classUnderTest.getChild(0)); assertEquals(1, serverNode.getChildCount()); assertEquals(layerNode, serverNode.getChild(0)); }
public WmsLayerNode addWmsLayer(WMSLayerInfo layer) { if (layer == null) { return null; } WmsServerNode serverNode = findServerNodeForLayer(layer); if (serverNode == null) { serverNode = new WmsServerNode(layer.getCaps()); addChild(serverNode); } WmsLayerNode wmsLayerNode = new WmsLayerNode(layer, true, 1.0); serverNode.addChild(wmsLayerNode); return wmsLayerNode; }
WmsRootNode extends FolderNode { public WmsLayerNode addWmsLayer(WMSLayerInfo layer) { if (layer == null) { return null; } WmsServerNode serverNode = findServerNodeForLayer(layer); if (serverNode == null) { serverNode = new WmsServerNode(layer.getCaps()); addChild(serverNode); } WmsLayerNode wmsLayerNode = new WmsLayerNode(layer, true, 1.0); serverNode.addChild(wmsLayerNode); return wmsLayerNode; } }
WmsRootNode extends FolderNode { public WmsLayerNode addWmsLayer(WMSLayerInfo layer) { if (layer == null) { return null; } WmsServerNode serverNode = findServerNodeForLayer(layer); if (serverNode == null) { serverNode = new WmsServerNode(layer.getCaps()); addChild(serverNode); } WmsLayerNode wmsLayerNode = new WmsLayerNode(layer, true, 1.0); serverNode.addChild(wmsLayerNode); return wmsLayerNode; } WmsRootNode();  WmsRootNode(String name, URL iconURL, boolean expanded); }
WmsRootNode extends FolderNode { public WmsLayerNode addWmsLayer(WMSLayerInfo layer) { if (layer == null) { return null; } WmsServerNode serverNode = findServerNodeForLayer(layer); if (serverNode == null) { serverNode = new WmsServerNode(layer.getCaps()); addChild(serverNode); } WmsLayerNode wmsLayerNode = new WmsLayerNode(layer, true, 1.0); serverNode.addChild(wmsLayerNode); return wmsLayerNode; } WmsRootNode();  WmsRootNode(String name, URL iconURL, boolean expanded); WmsLayerNode addWmsLayer(WMSLayerInfo layer); }
WmsRootNode extends FolderNode { public WmsLayerNode addWmsLayer(WMSLayerInfo layer) { if (layer == null) { return null; } WmsServerNode serverNode = findServerNodeForLayer(layer); if (serverNode == null) { serverNode = new WmsServerNode(layer.getCaps()); addChild(serverNode); } WmsLayerNode wmsLayerNode = new WmsLayerNode(layer, true, 1.0); serverNode.addChild(wmsLayerNode); return wmsLayerNode; } WmsRootNode();  WmsRootNode(String name, URL iconURL, boolean expanded); WmsLayerNode addWmsLayer(WMSLayerInfo layer);  }