Mercurial > projects > doodle
view import/p-model.d @ 0:e907d2c54ec3
Initial import
author | David Bryant <daveb@acres.com.au> |
---|---|
date | Wed, 13 May 2009 15:42:39 +0930 |
parents | |
children |
line wrap: on
line source
module dog.presentation.model; import dog.presentation.types; import util.list; class Property { this(char[] key, char[] value) { _key = key; _value = value; } char[] key() { return _key; } char[] value() { return _value; } private { char[] _key; char[] _value; } } interface IVisitor { void visit(GraphEdge); void visit(GraphNode); } class Diagram { } abstract class DiagramElement { this() { _is_visible = true; } abstract void accept(in IVisitor visitor); bool is_visible() { return _is_visible; } void add_property(Property property) { // TODO _properties.addTail(property); } private { List!(Property) _properties; bool _is_visible; GraphElement _container; } } abstract class SemanticModelBridge { this(char[] presentation) { _presentation = presentation; } char[] presentation() { return _presentation; } private { char[] _presentation; } } class SimpleSemanticModelElement : SemanticModelBridge { this(char[] type_info, char[] presentation) { super(presentation); _type_info = type_info; } char[] type_info() { return _type_info; } private { char[] _type_info; } } abstract class GraphElement : DiagramElement { this() { } void add_anchorage(GraphConnector anchorage) { // TODO } void remove_anchorage(GraphConnector anchorage) { } private { SemanticModelBridge _semantic_model; Point _position; List!(GraphConnector) _anchorages; List!(DiagramElement) _containeds; } } class GraphConnector { this(Point point) { _point = point; } private { Point _point; GraphElement _element; GraphEdge[] _edges; } } class GraphEdge : GraphElement { this() { } void accept(IVisitor visitor) { visitor.visit(this); } private { } } class GraphNode : GraphElement { this() { } void accept(IVisitor visitor) { visitor.visit(this); } private { } }