Mercurial > projects > doodle
comparison doodle/fig/diagram_elements.d @ 132:bc5baa585b32
Updated to dmd 2.060
author | David Bryant <bagnose@gmail.com> |
---|---|
date | Thu, 02 Aug 2012 15:32:43 +0930 |
parents | dcd641209671 |
children |
comparison
equal
deleted
inserted
replaced
130:1bc3475624d3 | 132:bc5baa585b32 |
---|---|
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 Rectangle bounds() const; | 16 @property Rectangle bounds() const; |
17 | 17 |
18 void draw(in Rectangle damage, scope Renderer cr) const; | 18 void draw(in Rectangle damage, scope Renderer cr) const; |
19 | 19 |
20 private { | 20 private { |
21 GraphElement _container; | 21 GraphElement _container; |
46 GraphEdge[] _graphEdges; | 46 GraphEdge[] _graphEdges; |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 final class GraphNode : GraphElement { | 50 final class GraphNode : GraphElement { |
51 override Rectangle bounds() const { return _bounds; } | 51 @property override Rectangle bounds() const { return _bounds; } |
52 | 52 |
53 override void draw(in Rectangle damage, scope Renderer cr) const { | 53 override void draw(in Rectangle damage, scope Renderer cr) const { |
54 } | 54 } |
55 | 55 |
56 private { | 56 private { |
57 Rectangle _bounds; | 57 Rectangle _bounds; |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 final class GraphEdge : GraphElement { | 61 final class GraphEdge : GraphElement { |
62 override Rectangle bounds() const { return _bounds; } | 62 @property override Rectangle bounds() const { return _bounds; } |
63 | 63 |
64 override void draw(in Rectangle damage, scope Renderer cr) const { | 64 override void draw(in Rectangle damage, scope Renderer cr) const { |
65 } | 65 } |
66 | 66 |
67 private { | 67 private { |
73 | 73 |
74 abstract class LeafElement : DiagramElement { | 74 abstract class LeafElement : DiagramElement { |
75 } | 75 } |
76 | 76 |
77 class TextElement : LeafElement { | 77 class TextElement : LeafElement { |
78 override Rectangle bounds() const { return _bounds; } | 78 @property override Rectangle bounds() const { return _bounds; } |
79 | 79 |
80 override void draw(in Rectangle damage, scope Renderer cr) const { | 80 override void draw(in Rectangle damage, scope Renderer cr) const { |
81 } | 81 } |
82 | 82 |
83 private { | 83 private { |
87 | 87 |
88 abstract class GraphicPrimitive : LeafElement { | 88 abstract class GraphicPrimitive : LeafElement { |
89 } | 89 } |
90 | 90 |
91 class PolylinePrimitive : GraphicPrimitive { | 91 class PolylinePrimitive : GraphicPrimitive { |
92 override Rectangle bounds() const { return _bounds; } | 92 @property override Rectangle bounds() const { return _bounds; } |
93 | 93 |
94 override void draw(in Rectangle damage, scope Renderer cr) const { | 94 override void draw(in Rectangle damage, scope Renderer cr) const { |
95 } | 95 } |
96 | 96 |
97 private { | 97 private { |
99 Rectangle _bounds; | 99 Rectangle _bounds; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 final class RectanglePrimitive : GraphicPrimitive { | 103 final class RectanglePrimitive : GraphicPrimitive { |
104 override Rectangle bounds() const { return _bounds; } | 104 @property override Rectangle bounds() const { return _bounds; } |
105 | 105 |
106 override void draw(in Rectangle damage, scope Renderer drawable) const { | 106 override void draw(in Rectangle damage, scope Renderer drawable) const { |
107 drawable.drawRectangle(bounds, false); | 107 drawable.drawRectangle(bounds, false); |
108 } | 108 } |
109 | 109 |