Mercurial > projects > doodle
changeset 31:fe66a856a630
Updated the instructions in the README
Removed the "import" code
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Thu, 20 Aug 2009 22:14:54 +0930 |
parents | 4a688da41f1a |
children | 705817d8514a |
files | .hgignore README doodle/import/model.d doodle/import/network.d doodle/import/new.d doodle/import/p_model.d doodle/import/types.d options |
diffstat | 8 files changed, 20 insertions(+), 372 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Sun Aug 09 09:12:55 2009 +0930 +++ b/.hgignore Thu Aug 20 22:14:54 2009 +0930 @@ -1,2 +0,0 @@ -doodle -.obj
--- a/README Sun Aug 09 09:12:55 2009 +0930 +++ b/README Thu Aug 20 22:14:54 2009 +0930 @@ -1,1 +1,19 @@ -Doodle - a tool for creating diagrams. +Doodle - a simple diagramming tool + +Build instructions: + +1. Add any comiler directives you need to the options file. + eg: + -I<path-to-gtkd-includes> + +2. Configure the project: + rdmd configure.d <full-path-to-build-dir> + eg: + rdmd configure.d ${PWD}/../build + +3. Build doodle: + cd ../build + ./build + +4. Launch doodle: + ./bin/doodle
--- a/doodle/import/model.d Sun Aug 09 09:12:55 2009 +0930 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -module doodle.interaction.model; - - -final class Manipulator { -} - -abstract class Selector { - this(Fig selected) { - _selected = selected; - } - - Fig selected() { return _selected; } - - //abstract void draw(Screen screen); - - private { - Fig _selected; - } -} - -abstract class Fig { - //DiagramElement element() { return _element; } - - //abstract void draw(Canvas canvas); - - abstract Selector create_selector(); - - private { - //DiagramElement _element; - } -} - -abstract class NetFig : Fig { - //GraphElement element() { return _element; } - - private { - //GraphElement _element; - } -} - -abstract class EdgeFig : NetFig { - //GraphEdge element() { return _element; } - - private { - //GraphEdge _element; - } -} - -abstract class NodeFig : NetFig { - //GraphNode element() { return _element; } - - private { - //GraphNode _element; - } -}
--- a/doodle/import/network.d Sun Aug 09 09:12:55 2009 +0930 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -module doodle.presentation.network; - -//import doodle.presentation.model; - -version(none) { - -enum EdgeEnd { - Source, - Target -}; - -interface NetworkObserver { - // Node changes - - void node_added(GraphNode node, - GraphElement container); - void node_changed(GraphNode node); - void node_relocated(GraphNode node, - GraphElement container); - void node_removed(GraphNode node, - GraphElement container); - - // Edge changes - - void edge_added(GraphEdge node, - GraphConnector anchor1, GraphConnector anchor2); - void edge_changed(GraphEdge edge); - void edge_rerouted(); - void edge_removed(); -} - -interface Network { - void add_observer(NetworkObserver observer); - void remove_observer(NetworkObserver observer); - - // - // Interrogation: - // - - GraphNode[] get_root_nodes(); - - // Inquire whether in principle a node of node_type - // can be added at the given point, possibly nested - // within the nest node. The nest can be null. - bool can_add(char[] node_type, - Point point, // necessary? - GraphNode nest); - - bool can_relocate(GraphNode node); - - bool can_remove(GraphNode node); - - // Inquire whether in principle the source element can - // be connected to the target element using - // an edge of edge_type. This might return true even - // though the real operation would fail due to deeper checking. - bool can_connect(char[] edge_type, - GraphElement source_element, Point source_point, - GraphElement target_element, Point target_point); - - // Inquire whether in principle a given end of an existing edge - // can be rerouted from old_element to new_element at new_point. - // old_element and new_element may be the same element. - bool can_reroute(GraphEdge edge, EdgeEnd end, - GraphElement old_element, - GraphElement new_element, Point new_point); - - bool can_disconnect(GraphEdge edge); - - // - // Manipulation: - // - - // Attempt to really add a node... - GraphNode add(char[] node_type, /* initial properties, */ - Point point, - GraphNode nest); - - void relocate(GraphNode node, - GraphElement old_container, - GraphElement new_container, Point new_point); - - // Attempt to really remove a node - void remove(GraphNode node); - - // Attempt to really connect the source element to the target element - // using an edge of the given type with the given initial properties. - GraphEdge connect(char[] edge_type, /* initial properties, */ - GraphElement source_element, Point source_point, - GraphElement target_element, Point target_point); - - // Attempt to really reroute.. - void reroute(GraphEdge edge, EdgeEnd end, - GraphElement old_element, - GraphElement new_element, Point new_point); - - // Attempt to really remove an edge... - void disconnect(GraphEdge edge); -} - -}
--- a/doodle/import/new.d Sun Aug 09 09:12:55 2009 +0930 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -version(none) { - -//import doodle.import.types; -import tango.util.collection.ArraySeq; - -interface IProperty { -} - -interface ISemanticModelBridge { - char[] presentation(); -} - -interface ISimpleSemanticModelElement : ISemanticModelBridge { - char[] type_info(); -} - -interface IDiagramElement { - bool is_visible(); - IProperty[] get_properties(); - - void accept(in IVisitor visitor); -} - -interface IVisitor { - void visit(in IGraphNode node); - void visit(in IGraphEdge edge); -} - -interface IGraphElement : IDiagramElement { -} - -interface IGraphNode : IGraphElement { -} - -interface IGraphEdge : IGraphElement { -} - -interface IGraphConnector { - Point point(); - IGraphElement element(); - IGraphEdge[] edges(); -} - -}
--- a/doodle/import/p_model.d Sun Aug 09 09:12:55 2009 +0930 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -//module doodle.dog.presentation.model; - -version(none) { - -import doodle.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 { - } -} - -}
--- a/doodle/import/types.d Sun Aug 09 09:12:55 2009 +0930 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -module doodle.presentation.types; - -final class Point { - this() { - _x = 0; - _y = 0; - } - - this(double x, double y) { - _x = x; - _y = y; - } - - private { - double _x; - double _y; - } -} - -final class Dimension { - this() { - _width = 0; - _height = 0; - } - - this(double width, double height) { - _width = width; - _height = height; - } - - private { - double _width; - double _height; - } -}