예제 #1
0
  @Test
  public void testStyle() {
    SimpleFeatureType unknownType = PlacemarkDescriptorRegistryTest.createYetUnknownFeatureType();
    Product p = new Product("p", "pt", 4, 4);
    VectorDataNode vdn = new VectorDataNode("vdn", unknownType);
    p.getVectorDataGroup().add(vdn);

    MyProductNodeListenerAdapter pnl = new MyProductNodeListenerAdapter();
    p.addProductNodeListener(pnl);

    String defaultStyleCss = vdn.getDefaultStyleCss();

    assertNull(vdn.getStyleCss());

    vdn.setStyleCss("fill:#aabbcc");
    assertEquals("fill:#aabbcc", vdn.getStyleCss());
    assertNotNull(pnl.event);
    assertEquals("styleCss", pnl.event.getPropertyName());
    assertEquals("fill:#aabbcc", pnl.event.getNewValue());
    pnl.event = null;
    vdn.setStyleCss("fill:#aabbcc");
    assertNull(pnl.event);
    vdn.setStyleCss("fill:#000000");
    assertNotNull(pnl.event);
    assertEquals("styleCss", pnl.event.getPropertyName());
    assertEquals("fill:#000000", pnl.event.getNewValue());

    // test that defaultStyleCss is not affected
    assertEquals(defaultStyleCss, vdn.getDefaultStyleCss());
  }
예제 #2
0
 @Test
 public void testVectorData() throws TransformException, FactoryException {
   SimpleFeatureType pinType = Placemark.createPinFeatureType();
   SimpleFeatureType gcpType = Placemark.createGcpFeatureType();
   SimpleFeatureType unknownType = PlacemarkDescriptorRegistryTest.createYetUnknownFeatureType();
   testVectorData(new VectorDataNode("Pins", pinType), "Pins", pinType);
   testVectorData(new VectorDataNode("GCPs", gcpType), "GCPs", gcpType);
   testVectorData(new VectorDataNode("Imported", unknownType), "Imported", unknownType);
 }