private List toLayerNames(List mapLayers) { ArrayList names = new ArrayList(); for (Iterator i = mapLayers.iterator(); i.hasNext(); ) { MapLayer layer = (MapLayer) i.next(); names.add(layer.getName()); } return names; }
/** Almacena el estilo seleccionado por el usuario */ private void saveStyle() { String style = (String) jcbStyle.getSelectedItem(); if (style != null) { List selectedLayer = this.mapLayerPanel.getSelectedItemsFromRigthList(); if (selectedLayer != null) { LayerNode node = (LayerNode) selectedLayer.get(0); MapLayer layer = node.getLayer(); String layerName = layer.getName(); selectedStyles.put(layerName, style); } // fin if } // fin if } // fin del método
/** Actualiza el comboBox de estilos con los estilos disponibles para la capa seleccionada */ private void updatejcbStyles() { List selectedLayer = this.mapLayerPanel.getSelectedItemsFromRigthList(); if (selectedLayer.size() == 1) { LayerNode node = (LayerNode) selectedLayer.get(0); MapLayer layer = node.getLayer(); List styles = getLayerStyles(layer.getName()); Iterator it = styles.iterator(); while (it.hasNext()) { Style style = (Style) it.next(); jcbStyleModel.addElement(style.getName()); } // fin del while if (selectedStyles != null) { String style = (String) selectedStyles.get(layer.getName()); if (style != null) jcbStyle.setSelectedItem(style); } } } // fin del método