categories for drag and drop. And rationalise the TODO a bit
authorRichard Fairhurst <richard@systemed.net>
Thu, 1 Jul 2010 10:58:03 +0000 (10:58 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 1 Jul 2010 10:58:03 +0000 (10:58 +0000)
TODO.txt
net/systemeD/potlatch2/TagViewer.mxml
potlatch2.mxml

index bd79127..6755aca 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -15,11 +15,6 @@ Potlatch 2: main outstanding issues
 * Import from OSM (is this worth sharing with the XML API stuff?)
 * Load GPX from API
 
-== Other core ==
-
-* Non-900913 projections
-* Plugin support
-
 == Saving ==
 
 * Should be able to reuse changesets
@@ -28,15 +23,8 @@ Potlatch 2: main outstanding issues
 == Tag editing ==
 
 * initialiseEditors is quite slow (typically 150ms)
-* Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
 * If a select name is too long then, the select menu seems to give a horizontal scrollbar instead of the name of the item e.g. cuisine#Coffee Shop
-* If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
-* It would be useful to have fields that only allow numbers in a non-destructive way, for example for step_count or capacity.
-* The area of pois for dragging on to the map should have a search, with synonyms and also be categorised like the lines are.
 * Bug where the wrong feature is used, when an item that is dragged from the list when an POI has no icon.
-* Checkboxes, for example what you can recycle, or whether something is a bridge or tunnel
-* Ability to specify that a node should be a point in a way, for example for crossings
-* Ability to say that it's unlikely/impossible to have a way that is a bridge and a tunnel at the same time.
 
 == UI ==
 
@@ -45,11 +33,6 @@ Potlatch 2: main outstanding issues
 * Custom imagery dialog fixes
 * Ctrl-clicking two areas (one inside the other) should create a multipolygon
 * B keypress for background source tag
-* Bbox-sensitive menu for background imagery
-* Mouse wheel zooming
-* CSS editing
-* Quick-search on add-relations-to-way dialog (RelationSelectPanel)
-* i18n
 * Multiple selection
 * Options should be remembered via SharedObjects
 
@@ -63,7 +46,39 @@ Potlatch 2: main outstanding issues
 * Shields
 * More line decoration (cliffs etc.), and implied values for 'dashes' if not supplied
 * MapCSS 0.2 support
-* 'Light' version without vectorlayer support etc.
 * .gz support for OSMConnection
 * Multipolygon rendering for dashedLine, lineDecoration, and WayBitmapFiller
 * Multipolygons should take their tags from the relation, not the way
+
+
+
+
+Requested enhancements
+----------------------
+
+== Other core ==
+
+* Non-900913 projections
+* Plugin support
+
+== Tag editing ==
+
+* Checkboxes, for example what you can recycle, or whether something is a bridge or tunnel
+* Ability to specify that a node should be a point in a way, for example for crossings
+* Ability to say that it's unlikely/impossible to have a way that is a bridge and a tunnel at the same time.
+* It would be useful to have fields that only allow numbers in a non-destructive way, for example for step_count or capacity.
+* Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
+* The area of pois for dragging on to the map should have a search, with synonyms.
+* If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
+
+== UI ==
+
+* Mouse wheel zooming
+* Bbox-sensitive menu for background imagery
+* CSS editing
+* Quick-search on add-relations-to-way dialog (RelationSelectPanel)
+* i18n
+
+== Rendering (Halcyon) ==
+
+* 'Light' version without vectorlayer support etc.
index 160cbc9..f56b660 100644 (file)
@@ -7,36 +7,41 @@
 
 <mx:ViewStack id="sidebar" width="100%" height="100%" creationPolicy="all">
   <mx:VBox id="dndPanel" width="100%" height="100%">
-    <!-- FIXME the panel text is repeated below for mouseOut -->
-    <mx:Text id="dndPanelText" text="Drag and Drop Points of Interest" />
-    <mx:TileList id="poiGrid" dataProvider="{MapFeatures.getInstance().pois}" width="100%" height="100%">
-      <mx:itemRenderer>
-        <mx:Component>
-          <mx:VBox mouseOver="parentDocument.dndPanelText.text = data.name"
-                   mouseOut="parentDocument.dndPanelText.text = 'Drag and Drop Points of Interest'">
-            <mx:Script><![CDATA[
-              import mx.events.DragEvent;
-              import mx.managers.DragManager;
-              import mx.core.DragSource;
-                  
-              private function dragPOI(event:MouseEvent, tags:Array):void {
-                  // Get the drag initiator component from the event object.
-                  var dragInitiator:Image = event.currentTarget as Image;
-                  var dragSource:DragSource = new DragSource();
-                  dragSource.addData(tags, 'tags');
-                  
-                  var dragProxy:Image = new Image();
-                  dragProxy.source = dragInitiator.source;
-                  dragProxy.width = dragInitiator.width;   // must set width and height explicitly
-                  dragProxy.height = dragInitiator.height; // for non-embedded images
-                  DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
-              }
-            ]]></mx:Script>
-            <mx:Image id="foo" source="{data.image}" height="25" width="25" mouseMove="dragPOI(event, data.tags)" toolTip="{data.name}" />
-          </mx:VBox>
-        </mx:Component>
-      </mx:itemRenderer>
-    </mx:TileList>
+    <mx:Text id="dndPanelText" text="{dndPrompt}" automationName="{dndPrompt}" />
+       <mx:Repeater id="dndRep" dataProvider="{MapFeatures.getInstance().getCategoriesForType('point')}">
+               <mx:HBox width="100%"><mx:Label text="{dndRep.currentItem.name}"/></mx:HBox>
+
+                       <mx:TileList dataProvider="{dndRep.currentItem.getFeaturesForType('point')}" width="100%" 
+                                    rowHeight="32" columnWidth="32" updateComplete="resizePOIGrid(event)">
+                               <mx:itemRenderer>
+                                       <mx:Component>
+                                               <mx:VBox mouseOver="parentDocument.dndPanelText.text = data.name"
+                                                                mouseOut="parentDocument.dndPanelText.text = parentDocument.dndPanelText.automationName">
+                                               <mx:Script><![CDATA[
+                                                       import mx.events.DragEvent;
+                                                       import mx.managers.DragManager;
+                                                       import mx.core.DragSource;
+
+                                                       private function dragPOI(event:MouseEvent, tags:Array):void {
+                                                               // Get the drag initiator component from the event object.
+                                                               var dragInitiator:Image = event.currentTarget as Image;
+                                                               var dragSource:DragSource = new DragSource();
+                                                               dragSource.addData(tags, 'tags');
+                                                               dragSource.addData(event.target.parent.parent.parent.parent, 'container');
+
+                                                               var dragProxy:Image = new Image();
+                                                               dragProxy.source = dragInitiator.source;
+                                                               dragProxy.width = dragInitiator.width;   // must set width and height explicitly
+                                                               dragProxy.height = dragInitiator.height; // for non-embedded images
+                                                               DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
+                                                       }
+                                               ]]></mx:Script>
+                                               <mx:Image id="foo" source="{data.image}" height="25" width="25" mouseMove="dragPOI(event, data.tags)" toolTip="{data.name}" />
+                                       </mx:VBox>
+                               </mx:Component>
+                       </mx:itemRenderer>
+               </mx:TileList>
+       </mx:Repeater>
   </mx:VBox>
   
   <mx:VBox id="tagsPanel" width="100%" height="100%" creationPolicy="auto">
       import mx.core.DragSource;
       import flexlib.containers.SuperTabNavigator;
 
+      private static const dndPrompt:String="Drag and drop points of interest";
+
       private var editorStackTabNavigator:SuperTabNavigator;
       private var editorStackAccordion:Accordion;
       [Bindable] private var editorStack:Container;
           UIComponent.resumeBackgroundProcessing();
       }
       
-      private function dragPOI(event:MouseEvent, tags:Array):void {
-          // Get the drag initiator component from the event object.
-          var dragInitiator:Image = event.currentTarget as Image;
-          var dragSource:DragSource = new DragSource();
-          dragSource.addData(tags, 'tags');
-          
-          var dragProxy:Image = new Image();
-          dragProxy.source = event.currentTarget.source;
-          
-          DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
-      }
+       private function resizePOIGrid(event:Event):void {
+               var rows:Number=event.target.dataProvider.length/event.target.columnCount;
+               if (rows!=Math.floor(rows)) { rows=Math.floor(rows+1); }
+               event.target.height=rows*(event.target.rowHeight+1);
+       }
   ]]></mx:Script>
 </mx:VBox>
 
index 34a1667..f796bcb 100755 (executable)
         }
         
         private function dragDropHandler(event:DragEvent):void {
-            // Get the data identified by the color format from the drag source.
-            // Blame http://www.adobe.com/devnet/flex/quickstart/adding_drag_and_drop/#manual
-            // for whatever horrid abuse of "color format" this is doing
+                       // Deselect the dragged icon
+                       if (event.dragSource.dataForFormat('container')) {
+                               event.dragSource.dataForFormat('container').selectedItem=-1;
+                       }
+
+                       // Get the tags
             var tags:Array = event.dragSource.dataForFormat('tags') as Array;
             var mapLoc:Point = Globals.vars.root.globalToLocal(new Point(event.stageX, event.stageY));
             var lat:Number = Globals.vars.root.coord2lat(mapLoc.y);