# HG changeset patch # User ymh # Date 1360840609 -3600 # Node ID 6a3084c7eb984cd2c4bcb665a91725fe6bd97696 # Parent 69924ca1b2339728a6b83df1cd8f8475fb6c93c5 add color diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/coweb/event/EdgeSyncEventManager.java --- a/server/src/main/java/org/iri_research/renkan/coweb/event/EdgeSyncEventManager.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/coweb/event/EdgeSyncEventManager.java Thu Feb 14 12:16:49 2013 +0100 @@ -85,7 +85,7 @@ String edge_id = (String)values.get("id"); - Edge edge = new Edge(edge_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), from_node, to_node, creator_id, project_id); + Edge edge = new Edge(edge_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), (String)values.get("color"), from_node, to_node, creator_id, project_id); Integer position = (Integer)data.get("position"); diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java --- a/server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/coweb/event/NodeSyncEventManager.java Thu Feb 14 12:16:49 2013 +0100 @@ -69,7 +69,7 @@ String node_id = (String)values.get("id"); - Node node = new Node(node_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), project_id, creator_id, nodePosition, image); + Node node = new Node(node_id, (String)values.get("title"), (String)values.get("description"), (String)values.get("uri"), (String)values.get("color"), project_id, creator_id, nodePosition, image); Integer position = (Integer)data.get("position"); diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/AbstractRenkanModel.java --- a/server/src/main/java/org/iri_research/renkan/models/AbstractRenkanModel.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/AbstractRenkanModel.java Thu Feb 14 12:16:49 2013 +0100 @@ -7,12 +7,13 @@ public abstract class AbstractRenkanModel implements IRenkanModel { - public AbstractRenkanModel(ID id, String title, String description, String uri) { + public AbstractRenkanModel(ID id, String title, String description, String uri, String color) { super(); this.id = id; this.title = title; this.description = description; this.uri = uri; + this.color = color; } protected AbstractRenkanModel() { @@ -22,6 +23,7 @@ protected String title; protected String description; protected String uri; + protected String color; @Override public String getTitle() { @@ -39,6 +41,11 @@ } @Override + public String getColor() { + return this.color; + } + + @Override public ID getId() { return this.id; } diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/Edge.java --- a/server/src/main/java/org/iri_research/renkan/models/Edge.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/Edge.java Thu Feb 14 12:16:49 2013 +0100 @@ -18,8 +18,8 @@ private String created_by; - public Edge(String id, String title, String description, String uri, Node from, Node to, String created_by, String project_id) { - super(id,title, description, uri); + public Edge(String id, String title, String description, String uri, String color, Node from, Node to, String created_by, String project_id) { + super(id,title, description, uri, color); this.from = from; this.to = to; this.created_by = created_by; diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/IRenkanModel.java --- a/server/src/main/java/org/iri_research/renkan/models/IRenkanModel.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/IRenkanModel.java Thu Feb 14 12:16:49 2013 +0100 @@ -18,5 +18,6 @@ public String getTitle(); public String getDescription(); public String getUri(); + public String getColor(); } diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/Node.java --- a/server/src/main/java/org/iri_research/renkan/models/Node.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/Node.java Thu Feb 14 12:16:49 2013 +0100 @@ -7,8 +7,8 @@ public class Node extends AbstractRenkanModel { - public Node(String id, String title, String description, String uri, String project_id, String created_by, Point position, String image) { - super(id, title, description, uri); + public Node(String id, String title, String description, String uri, String color, String project_id, String created_by, Point position, String image) { + super(id, title, description, uri, color); this.project_id = project_id; this.created_by = created_by; diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/Project.java --- a/server/src/main/java/org/iri_research/renkan/models/Project.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/Project.java Thu Feb 14 12:16:49 2013 +0100 @@ -41,7 +41,7 @@ public Project(String id, String title, String description, String uri, Date created, int revCounter) { - super(id,title, description, uri); + super(id,title, description, uri, null); this.revCounter = revCounter; this.created = created; if(this.created == null) { diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/ProjectRevision.java --- a/server/src/main/java/org/iri_research/renkan/models/ProjectRevision.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/ProjectRevision.java Thu Feb 14 12:16:49 2013 +0100 @@ -37,7 +37,7 @@ public ProjectRevision(ObjectId id, String title, String description, String uri, Project project, int revision, Date created) { - super(id, title, description, uri); + super(id, title, description, uri, null); this.project = project; this.revision = revision; if(created == null) { diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/RosterUser.java --- a/server/src/main/java/org/iri_research/renkan/models/RosterUser.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/RosterUser.java Thu Feb 14 12:16:49 2013 +0100 @@ -1,20 +1,17 @@ package org.iri_research.renkan.models; public class RosterUser extends AbstractRenkanModel { - - private String color; private String project_id; private Long site_id; private String client_id; public RosterUser(String id, String title, String description, String uri, String color, String project_id, Long site_id, String client_id) { - super(id, title, description, uri); + super(id, title, description, uri, color); this.project_id = project_id; this.site_id = site_id; this.client_id = client_id; - this.color = color; } public void setTitle(String title) { @@ -28,11 +25,7 @@ public void setUri(String uri) { this.uri = uri; } - - public String getColor() { - return this.color; - } - + public void setColor(String color) { this.color = color; } diff -r 69924ca1b233 -r 6a3084c7eb98 server/src/main/java/org/iri_research/renkan/models/User.java --- a/server/src/main/java/org/iri_research/renkan/models/User.java Thu Feb 14 10:39:24 2013 +0100 +++ b/server/src/main/java/org/iri_research/renkan/models/User.java Thu Feb 14 12:16:49 2013 +0100 @@ -5,15 +5,12 @@ @Document(collection="users") public class User extends AbstractRenkanModel { - private String color; - private String project_id; public User(String id, String title, String description, String uri, String color, String project_id) { - super(id, title, description, uri); + super(id, title, description, uri, color); this.project_id = project_id; - this.color = color; } public String getColor() {