Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.LayerLegendItem


                        if (eventNewObj instanceof Layer) {
                            Map map = getMap();
                            if (map != null) {
                                List<ILegendItem> legend = map.getLegend();
                                if (legend != null) {
                                    final LayerLegendItem layerLegendItem = ProjectFactory.eINSTANCE
                                            .createLayerLegendItem();
                                    layerLegendItem.setLayer((Layer) eventNewObj);

                                    legend.add(layerLegendItem);
                                }
                            }
                        }
View Full Code Here


     *
     * @param layer
     * @return true if removed, otherwise false
     */
    private boolean removeLayerLegendItem(Layer layer) {
        LayerLegendItem flaggedLayerItem = null;
        Map map = getMap();
        if (map == null) {
            return false; // legend not available
        }
        for (ILegendItem item : map.getLegend()) {
            if (item instanceof Folder) {
                final boolean isRemoved = removeLayerLegendItem((Folder) item, layer);
                if (isRemoved) {
                    return true;
                }
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                if (layer == layerItem.getLayer()) {
                    flaggedLayerItem = layerItem;
                    break;
                }
            }
        }
View Full Code Here

     * @param layer
     * @return true if removed, otherwise false
     */
    private boolean removeLayerLegendItem(Folder folder, Layer layer) {
        Folder flaggedFolder = null;
        LayerLegendItem flaggedLayerItem = null;
        for (ILegendItem item : folder.getItems()) {
            if (item instanceof Folder) {
                final boolean isRemoved = removeLayerLegendItem((Folder) item, layer);
                if (isRemoved) {
                    return true;
                }
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                if (layer == layerItem.getLayer()) {
                    flaggedFolder = folder;
                    flaggedLayerItem = layerItem;
                    break;
                }
            }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.LAYER_LEGEND_ITEM: {
            LayerLegendItem layerLegendItem = (LayerLegendItem) theEObject;
            T result = caseLayerLegendItem(layerLegendItem);
            if (result == null)
                result = caseLegendItem(layerLegendItem);
            if (result == null)
                result = caseILayerLegendItem(layerLegendItem);
View Full Code Here

    private static void updateCheckbox(final CheckboxTreeViewer viewer, final ILegendItem item) {
        if (item instanceof Folder) {
            final Folder folder = (Folder) item;
            updateCheckbox(viewer, folder);
        } else if (item instanceof LayerLegendItem) {
            final LayerLegendItem layerItem = (LayerLegendItem) item;
            updateCheckbox(viewer, layerItem);
        }
    }
View Full Code Here

        private void setVisibilityState(ILegendItem item, boolean isChecked) {
            if (item instanceof Folder) {
                final Folder folder = (Folder) item;
                setVisibilityState(folder, isChecked);
            } else if (item instanceof LayerLegendItem) {
                final LayerLegendItem layerItem = (LayerLegendItem) item;
                setVisibilityState(layerItem, isChecked);
            }
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.LayerLegendItem

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.