private static String getDataLine(Placemark placemark, Object[] values, int columnCountMin, int columnCount) { StringBuilder sb = new StringBuilder(); sb.append(placemark.getName()); for (int col = 0; col < columnCountMin; col++) { formatValue(values[col], sb); } sb.append("\t"); sb.append(placemark.getDescription()); for (int col = columnCountMin; col < columnCount; col++) { formatValue(values[col], sb); } return sb.toString(); }
placemark.getName(), placemark.getLabel(), placemark.getDescription(), placemark.getPixelPos(), placemark.getGeoPos(),
private void testReadStandardResult(List<Placemark> expectedPlacemarks, List<Placemark> actualPlacemarks, PlacemarkDescriptor descriptorInstance) { for (int i = 0; i < actualPlacemarks.size(); i++) { Placemark actualPlacemark = actualPlacemarks.get(i); Placemark expectedPlacemark = expectedPlacemarks.get(i); assertNotSame(expectedPlacemark, actualPlacemark); assertEquals(expectedPlacemark.getName(), actualPlacemark.getName()); assertEquals(expectedPlacemark.getLabel(), actualPlacemark.getLabel()); assertEquals(expectedPlacemark.getPixelPos(), actualPlacemark.getPixelPos()); assertEquals(expectedPlacemark.getGeoPos(), actualPlacemark.getGeoPos()); assertEquals(expectedPlacemark.getDescription(), actualPlacemark.getDescription()); PlacemarkDescriptor descriptor = expectedPlacemark.getDescriptor(); assertEquals(descriptor.getRoleLabel(), descriptorInstance.getRoleLabel()); } }
public static void writeXML(Placemark placemark, XmlWriter writer, int indent) { Guardian.assertNotNull("writer", writer); Guardian.assertGreaterThan("indent", indent, -1); final String[][] attributes = {new String[]{DimapProductConstants.ATTRIB_NAME, placemark.getName()}}; final String[] pinTags = XmlWriter.createTags(indent, DimapProductConstants.TAG_PLACEMARK, attributes); writer.println(pinTags[0]); indent++; writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_LABEL, placemark.getLabel()); writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_DESCRIPTION, placemark.getDescription()); final GeoPos geoPos = placemark.getGeoPos(); if (geoPos != null) { writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_LATITUDE, geoPos.lat); writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_LONGITUDE, geoPos.lon); } final PixelPos pixelPos = placemark.getPixelPos(); if (pixelPos != null && pixelPos.isValid()) { writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_PIXEL_X, pixelPos.x); writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_PIXEL_Y, pixelPos.y); } final String styleCss = placemark.getStyleCss(); if (styleCss != null && !styleCss.isEmpty()) { writer.printLine(indent, DimapProductConstants.TAG_PLACEMARK_STYLE_CSS, styleCss); } writer.println(pinTags[1]); }
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(); } }
assertNotNull("pin must be not null", placemark); assertEquals(pinName, placemark.getName()); assertEquals("", placemark.getDescription()); assertEquals(pinLat, placemark.getGeoPos().lat, 1e-15f); assertEquals(pinLon, placemark.getGeoPos().lon, 1e-15f); assertNotNull("pin must be not null", placemark); assertEquals(pinName, placemark.getName()); assertEquals(pinDesc, placemark.getDescription()); assertEquals(pinLat, placemark.getGeoPos().lat, 1e-15f); assertEquals(pinLon, placemark.getGeoPos().lon, 1e-15f); assertNotNull("pin must be not null", placemark); assertEquals(pinName, placemark.getName()); assertEquals(pinDesc, placemark.getDescription()); assertEquals(pinLat, placemark.getGeoPos().lat, 1e-15f); assertEquals(pinLon, placemark.getGeoPos().lon, 1e-15f);
dialog.setName(placemark.getName()); dialog.setLabel(placemark.getLabel()); dialog.setDescription(placemark.getDescription() != null ? placemark.getDescription() : "");