private List<Placemark> createPlacemarks(PlacemarkDescriptor descriptor, CrsGeoCoding geoCoding, Rectangle data_bounds) { ArrayList<Placemark> placemarkList = new ArrayList<Placemark>(); for (int i = 0; i < NUM_PLACEMARKS; i++) { PixelPos pixelPos = new PixelPos((float) Math.random() * data_bounds.width, (float) Math.random() * data_bounds.height); GeoPos geoPos = geoCoding.getGeoPos(pixelPos, null); Placemark placemark = Placemark.createPointPlacemark(descriptor, "name_" + i, "label_" + i, "description_" + i, pixelPos, geoPos, geoCoding); placemark.setStyleCss("fill:#FFFFFF;stroke:#000000"); placemarkList.add(placemark); } return placemarkList; }
placemarkStyleCss + ";" + getStyleCssFromOldFormat(element); placemark.setStyleCss(styleCss);
@Override public void setValueAt(Object value, int rowIndex, int columnIndex) { if (columnIndex == colorIndex) { final String colorName = DefaultFigureStyle.FILL_COLOR.getName(); final Placemark pin = getPlacemarkAt(rowIndex); final String styleCss = pin.getStyleCss(); FigureStyle style = new DefaultFigureStyle(); style.fromCssString(styleCss); style.setValue(colorName, value); pin.setStyleCss(style.toCssString()); } else { super.setValueAt(value, rowIndex, columnIndex); } } }
private void setFeatureStyleCss(SimpleFeatureFigure selectedFigure, FigureStyle style) { final VectorDataNode vectorDataNode = getVectorDataNode(); if (vectorDataNode != null) { // Transfer new style to associated placemark. Awful code :-( final Placemark placemark = vectorDataNode.getPlacemarkGroup().getPlacemark(selectedFigure.getSimpleFeature()); if (placemark != null) { placemark.setStyleCss(style.toCssString()); } else { final int index = selectedFigure.getSimpleFeature().getFeatureType().indexOf(Placemark.PROPERTY_NAME_STYLE_CSS); if (index != -1) { selectedFigure.getSimpleFeature().setAttribute(index, style.toCssString()); } } } } }
placemark.getGeoPos(), selectedProduct.getGeoCoding()); newPlacemark.setStyleCss(placemark.getStyleCss()); placemarksCopy.add(newPlacemark);
void copyActivePlacemark() { Guardian.assertNotNull("product", product); Placemark activePlacemark = getSelectedPlacemark(); Guardian.assertNotNull("activePlacemark", activePlacemark); Placemark newPlacemark = Placemark.createPointPlacemark(activePlacemark.getDescriptor(), "copy_of_" + activePlacemark.getName(), activePlacemark.getLabel(), activePlacemark.getDescription(), activePlacemark.getPixelPos(), activePlacemark.getGeoPos(), activePlacemark.getProduct().getGeoCoding()); newPlacemark.setStyleCss(activePlacemark.getStyleCss()); if (PlacemarkDialog.showEditPlacemarkDialog(getPaneWindow(), product, newPlacemark, placemarkDescriptor)) { makePlacemarkNameUnique(newPlacemark); updateUIState(); } }
assertEquals(4, eventTypes.size()); placemark1.setStyleCss("fill:#CAFEBABE"); assertEquals(1, product.getPinGroup().getNodeCount()); assertEquals(5, events.size());
placemark.setGeoPos(dialog.getGeoPos()); placemark.setPixelPos(dialog.getPixelPos()); placemark.setStyleCss(dialog.getStyleCss());