Package org.geomajas.configuration.client

Examples of org.geomajas.configuration.client.ClientLayerInfo


    Assert.assertNotNull(mapInfo.getWidgetInfo("layerTree"));
    Assert.assertEquals("layer1, layer2",
        ((ClientApplicationInfo.DummyClientWidgetInfo) mapInfo.getWidgetInfo("layerTree")).getDummy());

    // widget data on the layer
    ClientLayerInfo layerInfo = mapInfo.getLayers().get(0);
    for (ClientLayerInfo i : mapInfo.getLayers()) {
      if (i.getId().equals("countries")) {
        layerInfo = i;
      }
    }
    Assert.assertNotNull(layerInfo);
    Assert.assertNotNull(layerInfo.getWidgetInfo());
    Assert.assertNull(layerInfo.getWidgetInfo("layerTree"));
    Assert.assertNotNull(layerInfo.getWidgetInfo("customLayerInfoWidget"));
    Assert.assertEquals("org.geomajas.widget.IpsumWidget",
        ((ClientApplicationInfo.DummyClientWidgetInfo) layerInfo.getWidgetInfo("customLayerInfoWidget"))
            .getDummy());

  }
View Full Code Here


    Assert.assertEquals("toolbar", toolbar.getId());
    Assert.assertEquals(4, toolbar.getTools().size());

    List<ClientLayerInfo> layers = mapInfo.getLayers();
    Assert.assertEquals(1, layers.size());
    ClientLayerInfo layer = layers.get(0);
    Assert.assertEquals(CLIENT_LAYER_ID, layer.getId());
    Assert.assertEquals(LAYER_ID, layer.getServerLayerId());
    Assert.assertEquals("Test beans", layer.getLabel());
    Assert.assertTrue(layer.getLayerInfo() instanceof VectorLayerInfo);
    VectorLayerInfo vectorLayerInfo = ((VectorLayerInfo)layer.getLayerInfo());
    Assert.assertEquals("EPSG:4326", vectorLayerInfo.getCrs());
    Assert.assertNotNull(vectorLayerInfo.getFeatureInfo());
    FeatureInfo featureInfo = vectorLayerInfo.getFeatureInfo();
    List<AttributeInfo> attributes = featureInfo.getAttributes();
    Assert.assertNotNull(attributes);
View Full Code Here

    if (layer == null) {
      return false;
    }

    // Find attached ClientLayerInfo object:
    ClientLayerInfo layerInfo = null;
    String layerId = layer.getId();
    for (ClientLayerInfo info : mapInfo.getLayers()) {
      if (info.getId().equals(layerId)) {
        layerInfo = info;
        break;
View Full Code Here

    if (layer == null) {
      return false;
    }

    // Find attached ClientLayerInfo object:
    ClientLayerInfo layerInfo = null;
    String layerId = layer.getId();
    for (ClientLayerInfo info : mapInfo.getLayers()) {
      if (info.getId().equals(layerId)) {
        layerInfo = info;
        break;
View Full Code Here

    client.setInitialBounds(original.getInitialBounds());
    client.setPreferredPixelsPerTile(original.getPreferredPixelsPerTile());
    List<ClientLayerInfo> layers = new ArrayList<ClientLayerInfo>();
    client.setLayers(layers);
    for (ClientLayerInfo layer : original.getLayers()) {
      ClientLayerInfo clientLayer = securityClone(layer);
      if (null != clientLayer) {
        layers.add(clientLayer);
      }
    }
    client.setLayerTree(securityClone(original.getLayerTree()));
View Full Code Here

  public ClientLayerInfo securityClone(ClientLayerInfo original) {
    // the data is explicitly copied as this assures the security is considered when copying.
    if (null == original) {
      return null;
    }
    ClientLayerInfo client = null;
    String layerId = original.getServerLayerId();
    if (securityContext.isLayerVisible(layerId)) {
      client = (ClientLayerInfo) SerializationUtils.clone(original);
      if (client instanceof ClientVectorLayerInfo) {
        ClientVectorLayerInfo vectorLayer = (ClientVectorLayerInfo) client;
View Full Code Here

    client.setLabel(original.getLabel());
    client.setExpanded(original.isExpanded());
    List<ClientLayerInfo> layers = new ArrayList<ClientLayerInfo>();
    client.setLayers(layers);
    for (ClientLayerInfo layer : original.getLayers()) {
      ClientLayerInfo copy = securityClone(layer);
      if (null != copy) {
        layers.add(copy);
      }
    }
    List<ClientLayerTreeNodeInfo> nodes = new ArrayList<ClientLayerTreeNodeInfo>();
View Full Code Here

  public boolean moveLayer(Layer<?> layer, int index) {
    int currentIndex = getLayerPosition(layer);
    if (currentIndex < 0 || currentIndex == index) {
      return false;
    }
    ClientLayerInfo layerInfo = mapInfo.getLayers().get(currentIndex);

    // Check the new index:
    if (index < 0) {
      index = 0;
    } else if (index > layers.size() - 1) {
View Full Code Here

TOP

Related Classes of org.geomajas.configuration.client.ClientLayerInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.