@Override @Deprecated public PlacemarkGroup getPlacemarkGroup(Product product) { return product.getPinGroup(); }
@Override public void clearInsituPlacemarks() { final PlacemarkGroup pinGroup = tsProduct.getPinGroup(); for (Placemark insituPin : pinRelationMap.keySet()) { pinGroup.remove(insituPin); } pinRelationMap.clear(); }
@Override public void registerRelation(Placemark placemark, GeoPos insituGeopos) { pinRelationMap.put(placemark, insituGeopos); tsProduct.getPinGroup().add(placemark); }
/** * @return The (first) selected pin. * * @since BEAM 4.7 */ public Placemark getSelectedPin() { return getSelectedPlacemark(getProduct().getPinGroup()); }
/** * @param pin The pins to test. * * @return {@code true}, if the pin is selected. * * @since BEAM 4.7 */ public boolean isPinSelected(Placemark pin) { return isPlacemarkSelected(getProduct().getPinGroup(), pin); }
/** * @param pins The selected pins. * * @since BEAM 4.7 */ public void selectPins(Placemark[] pins) { selectPlacemarks(getProduct().getPinGroup(), pins); }
/** * @return The selected pins. * * @since BEAM 4.7 */ public Placemark[] getSelectedPins() { return getSelectedPlacemarks(getProduct().getPinGroup()); }
@Override protected void updateEnableState(ProductSceneView view) { setEnabled(view.getProduct().getPinGroup().getNodeCount() > 0); }
private void handlePlacemarkChanged() { final boolean placemarksSet = currentView.getProduct().getPinGroup().getNodeCount() > 0; graphForm.setExportEnabled(placemarksSet); updateTimeSeries(getTimeSeries()); } }
Layer getPinLayer(boolean create) { final VectorDataNode vectorDataNode = getProduct().getPinGroup().getVectorDataNode(); final Layer vectorDataCollectionLayer = getVectorDataCollectionLayer(create); if (vectorDataCollectionLayer != null) { return LayerUtils.getChildLayer(getRootLayer(), LayerUtils.SEARCH_DEEP, VectorDataLayerFilterFactory.createNodeFilter(vectorDataNode)); } else { return null; } }
public Placemark[] getPinPositionsToDisplay() { if (pinSupport.isShowingAllPins()) { final PlacemarkGroup pinGroup = timeSeries.getTsProduct().getPinGroup(); return pinGroup.toArray(new Placemark[pinGroup.getNodeCount()]); } else if (pinSupport.isShowingSelectedPins()) { return pinSupport.getSelectedPins(); } return new Placemark[0]; }
@Before public void setup() throws TransformException, FactoryException { final AffineTransform i2m = new AffineTransform(); i2m.scale(2.0, 2.0); final GeoCoding geoCoding = new CrsGeoCoding(DefaultGeographicCRS.WGS84, new Rectangle(0, 0, 10, 10), i2m); final Product product = new Product("P", "T", 10, 10); product.setGeoCoding(geoCoding); placemark = Placemark.createPointPlacemark(PinDescriptor.getInstance(), "P1", "L", "", new PixelPos(1.0f, 1.0f), null, product.getGeoCoding()); product.getPinGroup().add(placemark); }
Placemark[] getDisplayedPins() { if (isShowingSpectraForSelectedPins() && getCurrentView() != null) { return getCurrentView().getSelectedPins(); } else if (isShowingSpectraForAllPins() && getCurrentProduct() != null) { ProductNodeGroup<Placemark> pinGroup = getCurrentProduct().getPinGroup(); return pinGroup.toArray(new Placemark[pinGroup.getNodeCount()]); } else { return new Placemark[0]; } }
@Test public void testInitialPinVectorDataNodeState() throws Exception { final Product p = new Product("n", "t", 1, 1); assertNotNull(p.getPinGroup()); final VectorDataNode node = p.getVectorDataGroup().get("pins"); assertNotNull(node); assertTrue(node.getPlacemarkDescriptor() instanceof PinDescriptor); assertSame(p.getPinGroup(), p.getPinGroup()); assertSame(p.getPinGroup(), node.getPlacemarkGroup()); assertTrue(node.getFeatureCollection().isEmpty()); assertEquals(0, node.getPlacemarkGroup().getNodeCount()); assertTrue(node.isPermanent()); }
@Test public void testMaskIsRemovedWhenAllPinsAreRemoved() throws Exception { final Product p = new Product("P", "T", 1, 1); p.getPinGroup().add(Placemark.createPointPlacemark(PinDescriptor.getInstance(), "a", "a", "a", new PixelPos(), new GeoPos(), null)); p.getPinGroup().removeAll(); assertEquals(0, p.getMaskGroup().getNodeCount()); }
public static void main(String[] args) throws TransformException, FactoryException { Product product1 = new Product("A", "B", 360, 180); product1.setGeoCoding(new CrsGeoCoding(DefaultGeographicCRS.WGS84, 360, 180, -180.0, 90.0, 1.0, 1.0, 0.0, 0.0)); PinDescriptor descriptor = PinDescriptor.getInstance(); Placemark pin1 = Placemark.createPointPlacemark(descriptor, "pin_1", "Pin 1", "Schnatter!", new PixelPos(0, 0), new GeoPos(), product1.getGeoCoding()); product1.getPinGroup().add(pin1); showEditPlacemarkDialog(null, product1, pin1, descriptor); } }
@Test public void testMaskIsNotAddedWhenPinIsAddedForTheSecondTime() throws Exception { final Product p = new Product("P", "T", 1, 1); p.getPinGroup().add(Placemark.createPointPlacemark(PinDescriptor.getInstance(), "a", "a", "a", new PixelPos(), new GeoPos(), null)); p.getPinGroup().add(Placemark.createPointPlacemark(PinDescriptor.getInstance(), "b", "b", "b", new PixelPos(), new GeoPos(), null)); assertEquals(1, p.getMaskGroup().getNodeCount()); assertNotNull(p.getMaskGroup().get("pins")); }
@Test public void testMaskIsAddedWhenPinIsAddedForTheFirstTime() throws Exception { final Product p = new Product("P", "T", 1, 1); p.getPinGroup().add(Placemark.createPointPlacemark(PinDescriptor.getInstance(), "a", "a", "a", new PixelPos(), new GeoPos(), null)); assertEquals(1, p.getMaskGroup().getNodeCount()); assertNotNull(p.getMaskGroup().get("pins")); }
public void testNodeChangeIsObservable() { final Product p = new Product("p", "t", 10, 10); final ProductNodeGroup<Placemark> pinGroup = p.getPinGroup(); final Placemark placemark = Placemark.createPointPlacemark(PinDescriptor.getInstance(), "p1", "l1", "", new PixelPos(0, 0), null, null); pinGroup.add(placemark); final PNL listener = new PNL(Placemark.class); p.addProductNodeListener(listener); placemark.setLabel("new label"); assertEquals(true, p.isModified()); assertEquals("c:p1.label;", listener.trace); }
@Test public void testDeprecatedProperties() throws Exception { final Product product = new Product("n", "t", 1, 1); assertSame(product.getPinGroup(), instance.getPlacemarkGroup(product)); assertEquals("pin", instance.getRoleName()); assertEquals("pin", instance.getRoleLabel()); assertNull(instance.getCursorImage()); assertNotNull(instance.getCursorHotSpot()); assertEquals("showPinOverlay", instance.getShowLayerCommandId()); }