Mercurial > projects > doodle
comparison doodle/fig/diagram_elements.d @ 97:dcd641209671
What to do...
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Fri, 27 Aug 2010 18:01:33 +0930 |
parents | 66210d8ea37a |
children | bc5baa585b32 |
comparison
equal
deleted
inserted
replaced
96:66210d8ea37a | 97:dcd641209671 |
---|---|
11 interface IDiagram { | 11 interface IDiagram { |
12 void add(DiagramElement element); | 12 void add(DiagramElement element); |
13 } | 13 } |
14 | 14 |
15 abstract class DiagramElement { | 15 abstract class DiagramElement { |
16 /* | |
17 Rectangle bounds() const; | 16 Rectangle bounds() const; |
18 | 17 |
19 void draw(in Rectangle damage, scope Renderer cr) const; | 18 void draw(in Rectangle damage, scope Renderer cr) const; |
20 */ | |
21 | 19 |
22 private { | 20 private { |
23 //GraphElement _container; // FIXME use an interface to the container | 21 GraphElement _container; |
24 } | 22 } |
25 } | 23 } |
26 | 24 |
27 abstract class SemanticModelBridge { | 25 abstract class SemanticModelBridge { |
28 }; | 26 } |
27 | |
28 final class SimpleSemanticModelElement : SemanticModelBridge { | |
29 private { | |
30 string _typeInfo; | |
31 } | |
32 } | |
29 | 33 |
30 abstract class GraphElement : DiagramElement { | 34 abstract class GraphElement : DiagramElement { |
31 // Link to model via bridge goes here | 35 // Link to model via bridge goes here |
32 private { | 36 private { |
33 SemanticModelBridge _modelBridge; | 37 SemanticModelBridge _modelBridge; |
34 GraphConnector[] _anchorages; | 38 GraphConnector[] _anchorages; |
39 DiagramElement[] _containeds; | |
35 } | 40 } |
36 } | 41 } |
37 | 42 |
38 class GraphConnector { | 43 class GraphConnector { |
44 private { | |
45 GraphElement _graphElement; | |
46 GraphEdge[] _graphEdges; | |
47 } | |
39 } | 48 } |
40 | 49 |
41 final class GraphNode : GraphElement { | 50 final class GraphNode : GraphElement { |
51 override Rectangle bounds() const { return _bounds; } | |
52 | |
53 override void draw(in Rectangle damage, scope Renderer cr) const { | |
54 } | |
55 | |
56 private { | |
57 Rectangle _bounds; | |
58 } | |
42 } | 59 } |
43 | 60 |
44 final class GraphEdge : GraphElement { | 61 final class GraphEdge : GraphElement { |
62 override Rectangle bounds() const { return _bounds; } | |
63 | |
64 override void draw(in Rectangle damage, scope Renderer cr) const { | |
65 } | |
66 | |
45 private { | 67 private { |
46 GraphConnector[2] _anchors; | 68 GraphConnector[2] _anchors; |
69 Point[] _waypoints; | |
70 Rectangle _bounds; | |
47 } | 71 } |
48 } | 72 } |
49 | 73 |
50 abstract class LeafElement : DiagramElement { | 74 abstract class LeafElement : DiagramElement { |
51 } | 75 } |
52 | 76 |
53 class TextElement : LeafElement { | 77 class TextElement : LeafElement { |
78 override Rectangle bounds() const { return _bounds; } | |
79 | |
80 override void draw(in Rectangle damage, scope Renderer cr) const { | |
81 } | |
82 | |
83 private { | |
84 Rectangle _bounds; | |
85 } | |
54 } | 86 } |
55 | 87 |
56 abstract class GraphicPrimitive : LeafElement { | 88 abstract class GraphicPrimitive : LeafElement { |
57 } | 89 } |
58 | 90 |
59 class PolylinePrimitive : GraphicPrimitive { | 91 class PolylinePrimitive : GraphicPrimitive { |
92 override Rectangle bounds() const { return _bounds; } | |
93 | |
94 override void draw(in Rectangle damage, scope Renderer cr) const { | |
95 } | |
96 | |
60 private { | 97 private { |
61 Point[] _waypoints; | 98 Point[] _waypoints; |
99 Rectangle _bounds; | |
62 } | 100 } |
63 } | 101 } |
64 | 102 |
65 final class RectanglePrimitive : GraphicPrimitive { | 103 final class RectanglePrimitive : GraphicPrimitive { |
66 /* | 104 override Rectangle bounds() const { return _bounds; } |
105 | |
67 override void draw(in Rectangle damage, scope Renderer drawable) const { | 106 override void draw(in Rectangle damage, scope Renderer drawable) const { |
68 drawable.drawRectangle(bounds, false); | 107 drawable.drawRectangle(bounds, false); |
69 } | 108 } |
70 | |
71 override Rectangle bounds() const { return _bounds; } | |
72 */ | |
73 | 109 |
74 private { | 110 private { |
75 Rectangle _bounds; | 111 Rectangle _bounds; |
76 } | 112 } |
77 } | 113 } |