Package org.locationtech.udig.project.geoselection

Examples of org.locationtech.udig.project.geoselection.GeoSelectionEntry


        }

        if (currentMap != null) {

            HashMap<String, IGeoSelectionEntry> selectionBag = (HashMap<String, IGeoSelectionEntry>)currentMap.getBlackBoardInternal().get(PLATFORM_SELECTION_BAG);
            GeoSelectionEntry entry = (GeoSelectionEntry)selectionBag.get(context);
           
            IGeoSelection oldSelection = null;
           
            if(entry == null && selection != null){
                /*
                 * We need to create new IGeoSelectionEntry and reinitialize cache
                 * selection data structure.
                 */
                entry = new GeoSelectionEntry(context);
                entry.setSelection(selection);

                synchronized(this){
                    selectionBag.put(context, entry);
                    ArrayList<IGeoSelectionEntry> cache = new ArrayList<IGeoSelectionEntry>(selectionBag.values());

                    cachedSelections = Collections.unmodifiableList(cache);
                }

            }else if(entry != null && selection != null){
               
                oldSelection = entry.getSelection();
                entry.setSelection(selection);
               
            }else if(entry != null && selection == null){

                oldSelection = entry.getSelection();
                synchronized(this){
                    selectionBag.remove(context);
                    ArrayList<IGeoSelectionEntry> cache = new ArrayList<IGeoSelectionEntry>(selectionBag.values());
                    cachedSelections = Collections.unmodifiableList(cache);
                }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.geoselection.GeoSelectionEntry

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.