changeset 97:dcd641209671

What to do...
author David Bryant <bagnose@gmail.com>
date Fri, 27 Aug 2010 18:01:33 +0930
parents 66210d8ea37a
children cd0c9a4a7e44
files doodle/dia/tool.d doodle/dia/tool_layer.d doodle/fig/diagram_elements.d doodle/fig/network.d nobuild/thoughts.txt
diffstat 5 files changed, 60 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/doodle/dia/tool.d	Thu Aug 26 16:32:07 2010 +0930
+++ b/doodle/dia/tool.d	Fri Aug 27 18:01:33 2010 +0930
@@ -6,6 +6,8 @@
     import doodle.tk.events;
 }
 
+//
+
 abstract class Tool {
     this (in string name) {
         _name = name;
--- a/doodle/dia/tool_layer.d	Thu Aug 26 16:32:07 2010 +0930
+++ b/doodle/dia/tool_layer.d	Fri Aug 27 18:01:33 2010 +0930
@@ -9,7 +9,7 @@
 }
 
 // This interface is used by the palette
-interface IToolStack {
+interface IToolStack {      // Rename this because the stack aspect is not significant.
     void use(Tool tool);
 }
 
--- a/doodle/fig/diagram_elements.d	Thu Aug 26 16:32:07 2010 +0930
+++ b/doodle/fig/diagram_elements.d	Fri Aug 27 18:01:33 2010 +0930
@@ -13,37 +13,61 @@
 }
 
 abstract class DiagramElement {
-    /*
     Rectangle bounds() const;
 
     void draw(in Rectangle damage, scope Renderer cr) const;
-    */
 
     private {
-        //GraphElement _container;                // FIXME use an interface to the container
+        GraphElement _container;
     }
 }
 
 abstract class SemanticModelBridge {
-};
+}
+
+final class SimpleSemanticModelElement : SemanticModelBridge {
+    private {
+        string _typeInfo;
+    }
+}
 
 abstract class GraphElement : DiagramElement {
     // Link to model via bridge goes here
     private {
         SemanticModelBridge _modelBridge;
         GraphConnector[] _anchorages;
+        DiagramElement[] _containeds;
     }
 }
 
 class GraphConnector {
+    private {
+        GraphElement _graphElement;
+        GraphEdge[] _graphEdges;
+    }
 }
 
 final class GraphNode : GraphElement {
+    override Rectangle bounds() const { return _bounds; }
+
+    override void draw(in Rectangle damage, scope Renderer cr) const {
+    }
+
+    private {
+        Rectangle _bounds;
+    }
 }
 
 final class GraphEdge : GraphElement {
+    override Rectangle bounds() const { return _bounds; }
+
+    override void draw(in Rectangle damage, scope Renderer cr) const {
+    }
+
     private {
         GraphConnector[2] _anchors;
+        Point[] _waypoints;
+        Rectangle _bounds;
     }
 }
 
@@ -51,26 +75,38 @@
 }
 
 class TextElement : LeafElement {
+    override Rectangle bounds() const { return _bounds; }
+
+    override void draw(in Rectangle damage, scope Renderer cr) const {
+    }
+
+    private {
+        Rectangle _bounds;
+    }
 }
 
 abstract class GraphicPrimitive : LeafElement {
 }
 
 class PolylinePrimitive : GraphicPrimitive {
+    override Rectangle bounds() const { return _bounds; }
+
+    override void draw(in Rectangle damage, scope Renderer cr) const {
+    }
+
     private {
         Point[] _waypoints;
+        Rectangle _bounds;
     }
 }
 
 final class RectanglePrimitive : GraphicPrimitive {
-    /*
+    override Rectangle bounds() const { return _bounds; }
+
     override void draw(in Rectangle damage, scope Renderer drawable) const {
         drawable.drawRectangle(bounds, false);
     }
 
-    override Rectangle bounds() const { return _bounds; }
-    */
-
     private {
         Rectangle _bounds;
     }
--- a/doodle/fig/network.d	Thu Aug 26 16:32:07 2010 +0930
+++ b/doodle/fig/network.d	Fri Aug 27 18:01:33 2010 +0930
@@ -22,8 +22,7 @@
 
     // Edge changes
 
-    void edgeAdded(GraphEdge node,
-                   GraphConnector anchor1, GraphConnector anchor2);
+    void edgeAdded(GraphEdge edge);
     void edgeChanged(GraphEdge edge);
     void edgeRerouted();
     void edgeRemoved();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nobuild/thoughts.txt	Fri Aug 27 18:01:33 2010 +0930
@@ -0,0 +1,12 @@
+
+Maybe make each layer handle events, otherwise, how will the selection layer
+clear the selection if you click outside of it, for example?
+
+The current scheme of continuing to send events to a tool/handler when it
+accepts the button press is inadequate. The tool/handler needs to be able
+to make explicit grabs independent of button state.
+
+Selection manager needs to find out about diagram-elements being removed
+
+How about pressing the delete key when item(s) are selected? This needs
+to be handled by the something that understands the selection...