# HG changeset patch # User David Bryant # Date 1282897893 -34200 # Node ID dcd64120967127e3f691f4de5310a0fe2175405f # Parent 66210d8ea37a124949de4e9be7309f20c106fd5f What to do... diff -r 66210d8ea37a -r dcd641209671 doodle/dia/tool.d --- 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; diff -r 66210d8ea37a -r dcd641209671 doodle/dia/tool_layer.d --- 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); } diff -r 66210d8ea37a -r dcd641209671 doodle/fig/diagram_elements.d --- 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; } diff -r 66210d8ea37a -r dcd641209671 doodle/fig/network.d --- 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(); diff -r 66210d8ea37a -r dcd641209671 nobuild/thoughts.txt --- /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...