Remove trunk directory

This commit is contained in:
Paulo Gustavo Veiga
2009-11-06 23:30:29 -02:00
parent 2494133fed
commit 75470a91fd
715 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public class ColaborationEmail
{
private String subject;
private String message;
public ColaborationEmail(){}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@@ -0,0 +1,77 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import java.util.Calendar;
import java.util.Set;
import java.util.HashSet;
public class Colaborator {
private long id;
private String email;
private Calendar creationDate;
private Set<MindmapUser> mindmapUsers = new HashSet<MindmapUser>();
public Colaborator() {}
public Colaborator(Set<MindmapUser> mindmapUsers) {
this.mindmapUsers = mindmapUsers;
}
public void setMindmapUsers(Set<MindmapUser> mindmapUsers)
{
this.mindmapUsers = mindmapUsers;
}
public void addMindmapUser(MindmapUser mindmaUser)
{
mindmapUsers.add(mindmaUser);
}
public Set<MindmapUser> getMindmapUsers()
{
return mindmapUsers;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Calendar getCreationDate() {
return creationDate;
}
public void setCreationDate(Calendar creationDate) {
this.creationDate = creationDate;
}
}

View File

@@ -0,0 +1,34 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public class Constants {
public static int WELCOME_MAP_ID =49 ;
public static final int MAX_MAP_NAME_LENGTH = 512;
public static final int MAX_MAP_DESCRIPTION_LENGTH = 512;
public static final int MAX_USER_USERNAME_LENGTH = 255;
public static final int MAX_USER_LASTNAME_LENGTH = 255;
public static final int MAX_USER_FIRSTNAME_LENGTH = 255;
public static final int MAX_USER_PASSWORD_LENGTH = 255;
public static final int MAX_COMMENT_LENGTH = 512;
public static final int MAX_SUBJECT_LENGTH = 100;
public static final int MAX_TAGS_LENGTH=1014;
}

View File

@@ -0,0 +1,53 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public enum Font {
VERDANA("Verdana"),
TIMES("Times"),
TAHOMA("Tahoma"),
ARIAL("Arial");
private String fontName;
Font (String name)
{
this.fontName = name;
}
public String getFontName()
{
return fontName;
}
public static boolean isValidFont(String font) {
boolean isValid = false;
try {
if (font != null) {
isValid = Font.valueOf(font.toUpperCase()) != null;
}
}
catch (IllegalArgumentException ignote) {
}
return isValid;
}
}

View File

@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public enum ImageFamily {
FLAG("FLAG","flag_"),
BULLET("BULLET","bullet_"),
TAG("TAG","tag_"),
NUMBER("NUMBER","number_"),
FACE("FACE","face_"),
FACE_FUNY("FACEFUNY","facefuny_"),
ARROW("ARROW","arrow_"),
ARROWC("ARROWC","arrowc_"),
CONN("CONN","conn_"),
BULB("BULB","bulb_"),
THUMB("THUMB","thumb_"),
TICK("TICK","tick_"),
ONOFF("ONOFF","onoff_"),
MONEY("MONEY","money_"),
CHART("CHART","chart_"),
TASK("TASK","task_");
private String prefix;
private String name;
ImageFamily(String name, String prefix) {
this.name = name;
this.prefix = prefix;
}
public String getPrefix() {
return prefix;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,288 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
// ...........................................................................................................
// (C) Copyright 1996/2007 Fuego Inc. All Rights Reserved
// THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF Fuego Inc.
// The copyright notice above does not evidence any actual or intended
// publication of such source code.
//
// Last changed on 2007-08-01 19:08:21 (-0300), by: imanzano. $Revision$
// ...........................................................................................................
package com.wisemapping.model;
import com.wisemapping.exporter.ExportProperties;
import com.wisemapping.exporter.SvgExporter;
import com.wisemapping.util.ZipUtils;
import com.wisemapping.xml.VmlToSvgConverter;
import com.wisemapping.exporter.ExportException;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.log4j.Logger;
import org.xml.sax.SAXException;
import javax.xml.bind.JAXBException;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.stream.XMLStreamException;
import javax.xml.transform.TransformerException;
import java.io.CharArrayReader;
import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
public class MindMap {
//~ Instance fields ......................................................................................
final Logger logger = Logger.getLogger(MindMap.class.getName());
private Calendar creationTime;
private String creator;
private String description;
private int id;
private boolean isPublic;
private Calendar lastModificationTime;
private String lastModifierUser;
private Set<MindmapUser> mindmapUsers = new HashSet<MindmapUser>();
private MindMapNative nativeBrowser;
private User owner;
private String properties;
private String tags;
private String title;
private byte[] xml;
public static void main(String argv[]) {
String xml = "pepe\n hole";
xml = xml.replace("'", "\\'");
xml = xml.replace("\n", "");
xml = xml.trim();
System.out.println("xml:" + xml);
}
//~ Constructors .........................................................................................
public MindMap() {
}
public MindMap(Set<MindmapUser> mindmapUsers) {
this.mindmapUsers = mindmapUsers;
}
//~ Methods ..............................................................................................
public void setXml(byte[] xml) {
this.xml = xml;
}
public byte[] getXml() {
return xml;
}
public String getUnzippedXml()
throws IOException {
return ZipUtils.zipToString(xml);
}
public void setProperties(String properties) {
this.properties = properties;
}
public String getProperties() {
String ret;
if (properties == null) {
ret = "{zoom:0.7,saveOnLoad:true}";
} else {
ret = properties;
}
return ret;
}
public Set<MindmapUser> getMindmapUsers() {
return mindmapUsers;
}
public void setMindmapUsers(Set<MindmapUser> mindmapUsers) {
this.mindmapUsers = mindmapUsers;
}
public void addMindmapUser(MindmapUser mindmaUser) {
mindmapUsers.add(mindmaUser);
}
public boolean isPublic() {
return isPublic;
}
public void setPublic(boolean isPublic) {
this.isPublic = isPublic;
}
public Calendar getLastModificationTime() {
return lastModificationTime;
}
public Date getLastModificationDate() {
return new Date();
}
public void setLastModificationTime(Calendar lastModificationTime) {
this.lastModificationTime = lastModificationTime;
}
public String getLastModifierUser() {
return lastModifierUser;
}
public void setLastModifierUser(String lastModifierUser) {
this.lastModifierUser = lastModifierUser;
}
public String getCreator() {
return creator;
}
public void setCreator(String creatorUser) {
this.creator = creatorUser;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getNativeXml()
throws IOException {
return getUnzippedXml();
}
public String getNativeXmlAsJsLiteral()
throws IOException {
String xml = getNativeXml();
if (xml != null) {
xml = xml.replace("'", "\\'");
xml = xml.replace("\n", "");
xml = xml.trim();
}
return xml;
}
public void setNativeXml(String nativeXml)
throws IOException {
this.xml = ZipUtils.stringToZip(nativeXml);
}
public void setTags(String tags) {
this.tags = tags;
}
public String getTags() {
return tags;
}
public char[] generateSvgXml()
throws IOException, JAXBException {
final MindMapNative mindmapNativeBrowser = this.getNativeBrowser();
String svgText = mindmapNativeBrowser.getUnzippedSvgXml();
if (svgText == null || svgText.length() == 0) {
// The map must be saved using IE. Convert VML to SVG.
// Add namespace to the converter ...
String vmlXml = mindmapNativeBrowser.getUnzippedVmlXml();
vmlXml = vmlXml.replaceFirst("<v:group ", "<v:group xmlns:v=\"http://wisemapping.com/xml/vmlmap\" ");
char[] bytes = vmlXml.toCharArray();
final CharArrayReader is = new CharArrayReader(bytes);
// Convert Map ...
final VmlToSvgConverter converter = new VmlToSvgConverter();
converter.convert(is);
final CharArrayWriter os = new CharArrayWriter();
converter.toXml(os);
return os.toCharArray();
} else {
String result = "<?xml version='1.0' encoding='UTF-8'?>\n" + svgText;
// Add namespace...
result = result.replaceFirst("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
result = result.replaceAll("<image([^>]+)>", "<image$1/>");
return result.toCharArray();
}
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Calendar getCreationTime() {
return creationTime;
}
public void setCreationTime(Calendar creationTime) {
this.creationTime = creationTime;
}
public void export(final ExportProperties properties, OutputStream output) throws JAXBException, TranscoderException, TransformerException, IOException, ParserConfigurationException, ExportException, SAXException, XMLStreamException {
SvgExporter.export(properties, this, output);
}
public void setOwner(User owner) {
this.owner = owner;
}
public User getOwner() {
return owner;
}
public MindMapNative getNativeBrowser() {
return nativeBrowser;
}
public void setNativeBrowser(MindMapNative nativeBrowser) {
this.nativeBrowser = nativeBrowser;
}
}

View File

@@ -0,0 +1,86 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import java.util.List;
import java.util.ArrayList;
public class MindMapCriteria {
private String title;
private String description;
private List<String> tags = new ArrayList<String>();
private boolean orConnector = false;
private int pageNro = 0;
public MindMapCriteria() {
}
public int getPageNro()
{
return pageNro;
}
public void setPageNro(int page)
{
this.pageNro = page;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void orCriteria() {
this.orConnector = true;
}
public void andCriteria() {
this.orConnector = false;
}
public boolean isOrCriteria() {
return this.orConnector;
}
public boolean isEmpty() {
return !(getTags() != null && !getTags().isEmpty() || getTitle() != null || getDescription() != null);
}
public static MindMapCriteria EMPTY_CRITERIA = new MindMapCriteria();
}

View File

@@ -0,0 +1,85 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import com.wisemapping.util.ZipUtils;
import java.util.Calendar;
import java.io.IOException;
public class MindMapHistory {
private int id;
private Calendar creationTime;
private String creator;
private byte[] xml;
private int mindmapId;
public MindMapHistory()
{
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getMindmapId() {
return mindmapId;
}
public void setMindmapId(int id) {
this.mindmapId = id;
}
public Calendar getCreationTime() {
return creationTime;
}
public void setCreationTime(Calendar creationTime) {
this.creationTime = creationTime;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public byte[] getXml() {
return xml;
}
public void setXml(byte[] xml) {
this.xml = xml;
}
public String getNativeXml()
throws IOException
{
return ZipUtils.zipToString(xml);
}
}

View File

@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import com.wisemapping.util.ZipUtils;
import java.io.IOException;
/**
* This class contains the SVG and VML representation of the MindMap
*/
public class MindMapNative {
private int id;
private byte[] svgXml;
private byte[] vmlXml;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public byte[] getSvgXml() {
return svgXml;
}
public void setSvgXml(byte[] svgXml) {
this.svgXml = svgXml;
}
public byte[] getVmlXml() {
return vmlXml;
}
public void setVmlXml(byte[] vmlXml) {
this.vmlXml = vmlXml;
}
public String getUnzippedVmlXml()
throws IOException
{
return ZipUtils.zipToString(vmlXml);
}
public String getUnzippedSvgXml()
throws IOException
{
return ZipUtils.zipToString(svgXml);
}
public void setVmlXml(String xml) throws IOException {
// compress and set
vmlXml = ZipUtils.stringToZip(xml);
}
public void setSvgXml(String xml) throws IOException {
// compress and set
svgXml = ZipUtils.stringToZip(xml);
}
}

View File

@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public class MindmapImage
{
private String name;
private ImageFamily family;
public MindmapImage(String name, ImageFamily family)
{
this.name = name;
this.family = family;
}
public String getName()
{
return name;
}
public ImageFamily getFamily()
{
return family;
}
public String getId()
{
return family.getPrefix() + name;
}
}

View File

@@ -0,0 +1,217 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import java.util.*;
public class MindmapImagesFactory {
private static Map<ImageFamily,List<MindmapImage>> images = new HashMap<ImageFamily,List<MindmapImage>>();
static {
images.put(ImageFamily.BULLET, getImagesBullet());
images.put(ImageFamily.FLAG,getImagesFlag());
images.put(ImageFamily.NUMBER,getImagesNumber());
images.put(ImageFamily.TAG,getImagesTag());
images.put(ImageFamily.TASK,getImagesTask());
images.put(ImageFamily.FACE,getImagesFaces());
images.put(ImageFamily.BULB,getImagesBulb());
images.put(ImageFamily.ARROW,getImagesArrow());
images.put(ImageFamily.ARROWC,getImagesArrowC());
images.put(ImageFamily.CONN,getImagesConn());
images.put(ImageFamily.THUMB,getImagesThumbs());
images.put(ImageFamily.TICK,getImagesTick());
images.put(ImageFamily.ONOFF,getImagesOnOff());
images.put(ImageFamily.MONEY,getImagesMoney());
images.put(ImageFamily.CHART,getImagesChart());
}
private static List<MindmapImage> getImagesFaces()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("plain",ImageFamily.FACE));
images.add(new MindmapImage("sad",ImageFamily.FACE));
images.add(new MindmapImage("crying",ImageFamily.FACE));
images.add(new MindmapImage("smile",ImageFamily.FACE));
images.add(new MindmapImage("surprise",ImageFamily.FACE));
images.add(new MindmapImage("wink",ImageFamily.FACE));
return images;
}
private static List<MindmapImage> getImagesArrow()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("up",ImageFamily.ARROW));
images.add(new MindmapImage("down",ImageFamily.ARROW));
images.add(new MindmapImage("left",ImageFamily.ARROW));
images.add(new MindmapImage("right",ImageFamily.ARROW));
return images;
}
private static List<MindmapImage> getImagesArrowC()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("undo",ImageFamily.ARROWC));
images.add(new MindmapImage("rotate_anticlockwise",ImageFamily.ARROWC));
images.add(new MindmapImage("rotate_clockwise",ImageFamily.ARROWC));
images.add(new MindmapImage("turn_left",ImageFamily.ARROWC));
images.add(new MindmapImage("turn_right",ImageFamily.ARROWC));
return images;
}
private static List<MindmapImage> getImagesBulb()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("light_on",ImageFamily.BULB));
images.add(new MindmapImage("light_off",ImageFamily.BULB));
return images;
}
private static List<MindmapImage> getImagesTick()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("tick",ImageFamily.TICK));
images.add(new MindmapImage("cross",ImageFamily.TICK));
return images;
}
private static List<MindmapImage> getImagesChart()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("bar",ImageFamily.CHART));
images.add(new MindmapImage("line",ImageFamily.CHART));
images.add(new MindmapImage("curve",ImageFamily.CHART));
images.add(new MindmapImage("pie",ImageFamily.CHART));
images.add(new MindmapImage("organisation",ImageFamily.CHART));
return images;
}
private static List<MindmapImage> getImagesOnOff()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("clock",ImageFamily.ONOFF));
images.add(new MindmapImage("clock_red",ImageFamily.ONOFF));
images.add(new MindmapImage("add",ImageFamily.ONOFF));
images.add(new MindmapImage("delete",ImageFamily.ONOFF));
return images;
}
private static List<MindmapImage> getImagesMoney()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("money",ImageFamily.MONEY));
images.add(new MindmapImage("dollar",ImageFamily.MONEY));
images.add(new MindmapImage("euro",ImageFamily.MONEY));
images.add(new MindmapImage("pound",ImageFamily.MONEY));
images.add(new MindmapImage("yen",ImageFamily.MONEY));
images.add(new MindmapImage("coins",ImageFamily.MONEY));
images.add(new MindmapImage("ruby",ImageFamily.MONEY));
return images;
}
private static List<MindmapImage> getImagesThumbs()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("thumb_up",ImageFamily.THUMB));
images.add(new MindmapImage("thumb_down",ImageFamily.THUMB));
return images;
}
private static List<MindmapImage> getImagesConn()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("connect",ImageFamily.CONN));
images.add(new MindmapImage("disconnect",ImageFamily.CONN));
return images;
}
private static List<MindmapImage> getImagesBullet()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("black",ImageFamily.BULLET));
images.add(new MindmapImage("blue",ImageFamily.BULLET));
images.add(new MindmapImage("green",ImageFamily.BULLET));
images.add(new MindmapImage("orange",ImageFamily.BULLET));
images.add(new MindmapImage("red",ImageFamily.BULLET));
images.add(new MindmapImage("pink",ImageFamily.BULLET));
images.add(new MindmapImage("purple",ImageFamily.BULLET));
return images;
}
private static List<MindmapImage> getImagesFlag()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("blue",ImageFamily.FLAG));
images.add(new MindmapImage("green",ImageFamily.FLAG));
images.add(new MindmapImage("orange",ImageFamily.FLAG));
images.add(new MindmapImage("pink",ImageFamily.FLAG));
images.add(new MindmapImage("purple",ImageFamily.FLAG));
images.add(new MindmapImage("yellow",ImageFamily.FLAG));
return images;
}
private static List<MindmapImage> getImagesNumber()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("one",ImageFamily.NUMBER));
images.add(new MindmapImage("two",ImageFamily.NUMBER));
images.add(new MindmapImage("three",ImageFamily.NUMBER));
images.add(new MindmapImage("four",ImageFamily.NUMBER));
images.add(new MindmapImage("five",ImageFamily.NUMBER));
images.add(new MindmapImage("six",ImageFamily.NUMBER));
images.add(new MindmapImage("seven",ImageFamily.NUMBER));
images.add(new MindmapImage("eight",ImageFamily.NUMBER));
images.add(new MindmapImage("nine",ImageFamily.NUMBER));
return images;
}
private static List<MindmapImage> getImagesTag()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("blue",ImageFamily.TAG));
images.add(new MindmapImage("green",ImageFamily.TAG));
images.add(new MindmapImage("orange",ImageFamily.TAG));
images.add(new MindmapImage("red",ImageFamily.TAG));
images.add(new MindmapImage("pink",ImageFamily.TAG));
images.add(new MindmapImage("yellow",ImageFamily.TAG));
return images;
}
private static List<MindmapImage> getImagesTask()
{
final List<MindmapImage> images = new ArrayList<MindmapImage>();
images.add(new MindmapImage("one",ImageFamily.TASK));
images.add(new MindmapImage("two",ImageFamily.TASK));
images.add(new MindmapImage("three",ImageFamily.TASK));
images.add(new MindmapImage("four",ImageFamily.TASK));
images.add(new MindmapImage("five",ImageFamily.TASK));
return images;
}
public static Collection<List<MindmapImage>> getAllImages()
{
return images.values();
}
public static List<MindmapImage> getImagesByFamily(ImageFamily family)
{
return images.get(family);
}
}

View File

@@ -0,0 +1,89 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public class MindmapUser {
private int id;
private int roleId;
private MindMap mindMap;
private Colaborator colaborator;
public MindmapUser(){ }
public MindmapUser(int role, Colaborator colaborator , MindMap mindmap)
{
this.roleId = role;
this.mindMap =mindmap;
this.colaborator = colaborator;
// Guarantee referential integrity
mindmap.addMindmapUser(this);
colaborator.addMindmapUser(this);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
public UserRole getRole() {
return UserRole.values()[roleId];
}
public boolean isOwner() {
return getRole() == UserRole.OWNER;
}
public boolean isCollaborator() {
return getRole() == UserRole.COLLABORATOR;
}
public boolean isViewer() {
return getRole() == UserRole.VIEWER;
}
public MindMap getMindMap() {
return mindMap;
}
public void setMindMap(MindMap mindMap) {
this.mindMap = mindMap;
}
public Colaborator getColaborator() {
return colaborator;
}
public void setColaborator(Colaborator colaborator) {
this.colaborator = colaborator;
}
}

View File

@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public enum ShapeStyle
{
LINE("line"),
ROUNDED_RETAGLE("rounded rectagle"),
RECTAGLE("rectagle"),
ELIPSE("elipse");
private String style;
ShapeStyle(String style)
{
this.style = style;
}
public String getStyle()
{
return style;
}
}

View File

@@ -0,0 +1,141 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import java.io.Serializable;
import java.util.*;
public class User
extends Colaborator
implements Serializable
{
private String firstname;
private String lastname;
private String password;
private long activationCode;
private Calendar activationDate;
private String username;
private Set<String> tags = new HashSet<String>();
private boolean allowSendEmail = false;
public User() {
}
public void setTags(Set<String> tags)
{
this.tags = tags;
}
public Set<String> getTags()
{
return tags;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public boolean isActive() {
return activationDate != null;
}
public void setActivationCode(long code) {
this.activationCode = code;
}
public long getActivationCode() {
return activationCode;
}
public void setActivationDate(Calendar date) {
this.activationDate = date;
}
public Calendar getActivationDate() {
return activationDate;
}
public boolean isAllowSendEmail()
{
return allowSendEmail;
}
public void setAllowSendEmail(boolean allowSendEmail)
{
this.allowSendEmail = allowSendEmail;
}
public boolean getAllowSendEmail()
{
return allowSendEmail;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final User user = (User) o;
if (!getEmail().equals(user.getEmail())) return false;
if (firstname != null ? !firstname.equals(user.firstname) : user.firstname != null) return false;
if (lastname != null ? !lastname.equals(user.lastname) : user.lastname != null) return false;
if (password != null ? !password.equals(user.password) : user.password != null) return false;
return true;
}
public int hashCode() {
int result;
result = (firstname != null ? firstname.hashCode() : 0);
result = 29 * result + (lastname != null ? lastname.hashCode() : 0);
result = 29 * result + (password != null ? password.hashCode() : 0);
result = 29 * result + getEmail().hashCode();
return result;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}

View File

@@ -0,0 +1,84 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
import java.io.Serializable;
import java.util.Calendar;
public class UserLogin
implements Serializable
{
private int id;
private Calendar loginDate = null;
private String email = null;
public UserLogin()
{
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public void setLoginDate(Calendar loginDate)
{
this.loginDate = loginDate;
}
public Calendar getLoginDate()
{
return loginDate;
}
public void setEmail(String email)
{
this.email = email;
}
public String getEmail()
{
return email;
}
/*
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final UserLogin userLogin = (UserLogin) o;
if (loginDate.equals(userLogin.loginDate)) return false;
if (email.equals(userLogin.email)) return false;
return true;
}
public int hashCode() {
int result;
result = (loginDate!= null ? loginDate.hashCode() : 0);
result = 29 * result + (email != null ? email.hashCode() : 0);
return result;
}
*/
}

View File

@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
*/
package com.wisemapping.model;
public enum UserRole {
OWNER(true, true, true), COLLABORATOR(true, true, false), VIEWER(false, true, false);
private final boolean hasEditPermission;
private final boolean hasViewPermission;
private final boolean hasDeletePermission;
private UserRole(boolean hasEditPermission, boolean hasViewPermission, boolean hasDeletePermission) {
this.hasEditPermission = hasEditPermission;
this.hasViewPermission = hasViewPermission;
this.hasDeletePermission = hasDeletePermission;
}
public boolean hasEditPermission() {
return hasEditPermission;
}
public boolean hasViewPermission() {
return hasViewPermission;
}
public boolean hasDeletePermission() {
return hasDeletePermission;
}
}