Fix toolbar title bug
Add properties peer user.
This commit is contained in:
@@ -82,8 +82,14 @@ public class Collaboration {
|
||||
this.collaborator = collaborator;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CollaborationProperties getCollaborationProperties() {
|
||||
return collaborationProperties;
|
||||
CollaborationProperties result = collaborationProperties;
|
||||
if (result == null) {
|
||||
collaborationProperties = new CollaborationProperties();
|
||||
result = collaborationProperties;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setCollaborationProperties(@NotNull CollaborationProperties collaborationProperties) {
|
||||
|
||||
@@ -18,11 +18,15 @@
|
||||
|
||||
package com.wisemapping.model;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CollaborationProperties {
|
||||
private static final String DEFAULT_JSON_PROPERTIES = "{zoom:0.8}";
|
||||
private int id;
|
||||
private boolean starred;
|
||||
private String mindmapProperties;
|
||||
|
||||
public CollaborationProperties(){
|
||||
public CollaborationProperties() {
|
||||
|
||||
}
|
||||
|
||||
@@ -41,4 +45,13 @@ public class CollaborationProperties {
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getMindmapProperties() {
|
||||
return mindmapProperties == null ? DEFAULT_JSON_PROPERTIES : mindmapProperties;
|
||||
}
|
||||
|
||||
public void setMindmapProperties(@NotNull String mindmapProperties) {
|
||||
this.mindmapProperties = mindmapProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,21 +92,6 @@ public class MindMap {
|
||||
this.xml = ZipUtils.zipToString(xml).getBytes(UTF_8);
|
||||
}
|
||||
|
||||
public void setProperties(String properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
public String getProperties() {
|
||||
String ret;
|
||||
if (properties == null) {
|
||||
ret = "{zoom:0.85,saveOnLoad:true}";
|
||||
} else {
|
||||
ret = properties;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Set<Collaboration> getCollaborations() {
|
||||
return collaborations;
|
||||
}
|
||||
@@ -237,6 +222,12 @@ public class MindMap {
|
||||
}
|
||||
|
||||
public void setStarred(@NotNull Collaborator collaborator, boolean value) throws WiseMappingException {
|
||||
final CollaborationProperties collaborationProperties = getCollaborationProperties(collaborator);
|
||||
collaborationProperties.setStarred(value);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CollaborationProperties getCollaborationProperties(@NotNull Collaborator collaborator) throws WiseMappingException {
|
||||
if (collaborator == null) {
|
||||
throw new IllegalStateException("Collaborator can not be null");
|
||||
}
|
||||
@@ -245,11 +236,7 @@ public class MindMap {
|
||||
if (collaboration == null) {
|
||||
throw new WiseMappingException("User is not collaborator");
|
||||
}
|
||||
|
||||
if (collaboration.getCollaborationProperties() == null) {
|
||||
collaboration.setCollaborationProperties(new CollaborationProperties());
|
||||
}
|
||||
collaboration.getCollaborationProperties().setStarred(value);
|
||||
return collaboration.getCollaborationProperties();
|
||||
}
|
||||
|
||||
public boolean isStarred(@NotNull Collaborator collaborator) {
|
||||
@@ -271,7 +258,6 @@ public class MindMap {
|
||||
final MindMap result = new MindMap();
|
||||
result.setDescription(this.getDescription());
|
||||
result.setTitle(this.getTitle());
|
||||
result.setProperties(this.getProperties());
|
||||
result.setXml(this.getXml());
|
||||
result.setTags(this.getTags());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user