From 4e0c62199441b3ea7fe84c75735e68ecfc3f8ac2 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 23 Nov 2020 19:39:34 -0800 Subject: [PATCH 01/98] Bump up version. --- core-js/pom.xml | 2 +- mindplot/pom.xml | 2 +- pom.xml | 4 ++-- web2d/pom.xml | 2 +- wise-editor/pom.xml | 2 +- wise-webapp/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core-js/pom.xml b/core-js/pom.xml index 907ca8c7..4ab4e1e6 100644 --- a/core-js/pom.xml +++ b/core-js/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT scm:git:git@bitbucket.org:wisemapping/wisemapping-open-source.git diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 6d2e3f13..b2e2388e 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT diff --git a/pom.xml b/pom.xml index 31f534ed..43e5bac1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT ${project.basedir}/wise-webapps @@ -16,7 +16,7 @@ org.wisemapping wisemapping WiseMapping Project - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT pom diff --git a/web2d/pom.xml b/web2d/pom.xml index b092eebe..213edfa9 100644 --- a/web2d/pom.xml +++ b/web2d/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT diff --git a/wise-editor/pom.xml b/wise-editor/pom.xml index 5a61bef6..8c712cac 100644 --- a/wise-editor/pom.xml +++ b/wise-editor/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 3d9d5b04..1b865b7f 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -9,7 +9,7 @@ org.wisemapping wisemapping ../pom.xml - 5.0.1-SNAPSHOT + 5.0.2-SNAPSHOT From cade40e1a3b9cca50f8485b5cdef6ce5e06ba463 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 24 Nov 2020 19:50:49 -0800 Subject: [PATCH 02/98] Add ads support --- wise-webapp/src/main/webapp/jsp/template.jsp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wise-webapp/src/main/webapp/jsp/template.jsp b/wise-webapp/src/main/webapp/jsp/template.jsp index 9b945628..d141c115 100644 --- a/wise-webapp/src/main/webapp/jsp/template.jsp +++ b/wise-webapp/src/main/webapp/jsp/template.jsp @@ -46,7 +46,9 @@ - + + + From 39ff095df7971dd5b5944c3df2713da79e5c183f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 28 Nov 2020 15:27:46 -0800 Subject: [PATCH 03/98] Remove openid --- wise-webapp/pom.xml | 8 +- .../filter/RequestPropertiesInterceptor.java | 4 - .../security/UserDetailsService.java | 148 ++++++------- .../wisemapping/webmvc/LoginController.java | 22 +- .../webmvc/PublicPagesController.java | 5 - .../src/main/webapp/WEB-INF/app.properties | 11 +- .../webapp/WEB-INF/classes/log4j.properties | 8 +- .../main/webapp/WEB-INF/defs/definitions.xml | 19 +- .../webapp/WEB-INF/wisemapping-security.xml | 27 --- wise-webapp/src/main/webapp/css/openid.css | 69 ------ wise-webapp/src/main/webapp/js/openid-en.js | 96 --------- .../src/main/webapp/js/openid-jquery.js | 203 ------------------ .../src/main/webapp/jsp/GCFInstall.jsp | 18 -- .../src/main/webapp/jsp/GCFPluginRequired.jsp | 11 - wise-webapp/src/main/webapp/jsp/login.jsp | 7 - .../src/main/webapp/jsp/loginOpenId.jsp | 56 ----- 16 files changed, 100 insertions(+), 612 deletions(-) delete mode 100644 wise-webapp/src/main/webapp/css/openid.css delete mode 100644 wise-webapp/src/main/webapp/js/openid-en.js delete mode 100644 wise-webapp/src/main/webapp/js/openid-jquery.js delete mode 100644 wise-webapp/src/main/webapp/jsp/GCFInstall.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/loginOpenId.jsp diff --git a/wise-webapp/pom.xml b/wise-webapp/pom.xml index 1b865b7f..74c4735e 100644 --- a/wise-webapp/pom.xml +++ b/wise-webapp/pom.xml @@ -86,9 +86,13 @@ org.springframework.security - spring-security-openid + spring-security-oauth2-client + ${org.springframework.addons} + + + org.springframework.security + spring-security-oauth2-jose ${org.springframework.addons} - compile org.springframework diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java index 819c2dfe..00b43c15 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/RequestPropertiesInterceptor.java @@ -45,9 +45,6 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { @Value("${security.type}") private String securityType; - @Value("${security.openid.enabled}") - private Boolean openIdEnabled; - public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception { request.setAttribute("google.analytics.enabled", analyticsEnabled); @@ -55,7 +52,6 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter { request.setAttribute("google.ads.enabled", adsEnabled); request.setAttribute("site.homepage", siteHomepage); request.setAttribute("security.type", securityType); - request.setAttribute("security.openid.enabled", openIdEnabled); // If the property could not be resolved, try to infer one from the request... diff --git a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java index 403e093f..c66aaa10 100644 --- a/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java +++ b/wise-webapp/src/main/java/com/wisemapping/security/UserDetailsService.java @@ -19,24 +19,16 @@ package com.wisemapping.security; -import com.wisemapping.exceptions.WiseMappingException; -import com.wisemapping.model.AuthenticationType; import com.wisemapping.model.User; import com.wisemapping.service.UserService; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - import org.springframework.dao.DataAccessException; import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.security.openid.OpenIDAttribute; -import org.springframework.security.openid.OpenIDAuthenticationToken; - -import java.util.Calendar; -import java.util.List; public class UserDetailsService - implements org.springframework.security.core.userdetails.UserDetailsService, org.springframework.security.core.userdetails.AuthenticationUserDetailsService { + implements org.springframework.security.core.userdetails.UserDetailsService{ private UserService userService; private String adminUser; @@ -51,76 +43,76 @@ public class UserDetailsService } } - @Override - @NotNull - public UserDetails loadUserDetails(@NotNull OpenIDAuthenticationToken token) throws UsernameNotFoundException { +// @Override +// @NotNull +// public UserDetails loadUserDetails(@NotNull OpenIDAuthenticationToken token) throws UsernameNotFoundException { +// +// final User tUser = buildUserFromToken(token); +// final User dbUser = userService.getUserBy(tUser.getEmail()); +// +// final User result; +// if (dbUser != null) { +// if (!token.getIdentityUrl().equals(dbUser.getAuthenticatorUri())) { +// throw new IllegalStateException("Identity url for this user can not change:" + token.getIdentityUrl()); +// } +// result = dbUser; +// } else { +// try { +// tUser.setAuthenticationType(AuthenticationType.OPENID); +// tUser.setAuthenticatorUri(token.getIdentityUrl()); +// +// result = userService.createUser(tUser, false, false); +// } catch (WiseMappingException e) { +// throw new IllegalStateException(e); +// } +// +// } +// return new UserDetails(result, isAdmin(result.getEmail())); +// } - final User tUser = buildUserFromToken(token); - final User dbUser = userService.getUserBy(tUser.getEmail()); - - final User result; - if (dbUser != null) { - if (!token.getIdentityUrl().equals(dbUser.getAuthenticatorUri())) { - throw new IllegalStateException("Identity url for this user can not change:" + token.getIdentityUrl()); - } - result = dbUser; - } else { - try { - tUser.setAuthenticationType(AuthenticationType.OPENID); - tUser.setAuthenticatorUri(token.getIdentityUrl()); - - result = userService.createUser(tUser, false, false); - } catch (WiseMappingException e) { - throw new IllegalStateException(e); - } - - } - return new UserDetails(result, isAdmin(result.getEmail())); - } - - @NotNull - private User buildUserFromToken(@NotNull OpenIDAuthenticationToken token) { - final User result = new User(); - - String lastName = null; - String firstName = null; - String email = null; - String fullName = null; - - final List attributes = token.getAttributes(); - for (OpenIDAttribute attribute : attributes) { - if (attribute.getName().equals("email")) { - email = attribute.getValues().get(0); - } - - if (attribute.getName().equals("firstname")) { - firstName = attribute.getValues().get(0); - - } - - if (attribute.getName().equals("lastname")) { - lastName = attribute.getValues().get(0); - } - - if (attribute.getName().equals("fullname")) { - fullName = attribute.getValues().get(0); - } - - } - if (lastName == null || firstName == null) { - result.setFirstname(fullName); - result.setLastname(""); - } else { - result.setLastname(lastName); - result.setFirstname(firstName); - } - result.setEmail(email); - result.setPassword(""); - - final Calendar now = Calendar.getInstance(); - result.setActivationDate(now); - return result; - } +// @NotNull +// private User buildUserFromToken(@NotNull OpenIDAuthenticationToken token) { +// final User result = new User(); +// +// String lastName = null; +// String firstName = null; +// String email = null; +// String fullName = null; +// +// final List attributes = token.getAttributes(); +// for (OpenIDAttribute attribute : attributes) { +// if (attribute.getName().equals("email")) { +// email = attribute.getValues().get(0); +// } +// +// if (attribute.getName().equals("firstname")) { +// firstName = attribute.getValues().get(0); +// +// } +// +// if (attribute.getName().equals("lastname")) { +// lastName = attribute.getValues().get(0); +// } +// +// if (attribute.getName().equals("fullname")) { +// fullName = attribute.getValues().get(0); +// } +// +// } +// if (lastName == null || firstName == null) { +// result.setFirstname(fullName); +// result.setLastname(""); +// } else { +// result.setLastname(lastName); +// result.setFirstname(firstName); +// } +// result.setEmail(email); +// result.setPassword(""); +// +// final Calendar now = Calendar.getInstance(); +// result.setActivationDate(now); +// return result; +// } private boolean isAdmin(@Nullable String email) { return email != null && adminUser != null && email.trim().endsWith(adminUser); diff --git a/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java b/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java index 0795a8e1..feffe5ee 100644 --- a/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java +++ b/wise-webapp/src/main/java/com/wisemapping/webmvc/LoginController.java @@ -45,16 +45,16 @@ public class LoginController { return result; } - @RequestMapping(value = "loginopenid", method = RequestMethod.GET) - protected ModelAndView showLoginOpenIdPage() { - final User user = Utils.getUser(false); - ModelAndView result; - if (user != null) { - result = new ModelAndView("forward:/c/maps/"); - } else { - result = new ModelAndView("loginopenid"); - } - return result; - } +// @RequestMapping(value = "loginopenid", method = RequestMethod.GET) +// protected ModelAndView showLoginOpenIdPage() { +// final User user = Utils.getUser(false); +// ModelAndView result; +// if (user != null) { +// result = new ModelAndView("forward:/c/maps/"); +// } else { +// result = new ModelAndView("loginopenid"); +// } +// return result; +// } } diff --git a/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java b/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java index e2fce9bd..e6fba763 100644 --- a/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java +++ b/wise-webapp/src/main/java/com/wisemapping/webmvc/PublicPagesController.java @@ -48,11 +48,6 @@ public class PublicPagesController { return "crew"; } - @RequestMapping(value = "GCFInstall") - public String showGCFInstallationPage() { - return "GCFInstall"; - } - @RequestMapping(value = "keyboard") public String newsPage() { return "keyboard"; diff --git a/wise-webapp/src/main/webapp/WEB-INF/app.properties b/wise-webapp/src/main/webapp/WEB-INF/app.properties index 162dbaa3..38b8171b 100755 --- a/wise-webapp/src/main/webapp/WEB-INF/app.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/app.properties @@ -138,9 +138,6 @@ security.ldap.auth.attribute=mail security.ldap.lastName.attribute=sn security.ldap.firstName.attribute=givenName -# Enable OpenId Authentication. -security.openid.enabled=false - # REST Documentation # # This properties are used for REST API Documentation( http://localhost:8080/wisemapping/doc/rest/index.html) @@ -149,6 +146,14 @@ documentation.services.basePath=http://localhost:8080/service documentation.services.version=3.0.1 +# OAuth2 Security + +#spring.security.oauth2.client.registration.google.client-id= +#spring.security.oauth2.client.registration.google.client-secret= + +#spring.security.oauth2.client.registration.facebook.client-id= +#spring.security.oauth2.client.registration.facebook.client-secret= + diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties index ca1eddf0..7ed90501 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/log4j.properties @@ -1,6 +1,6 @@ -log4j.rootLogger=WARN, stdout, R -log4j.logger.com.wisemapping=INFO,stdout,R -log4j.logger.org.springframework=INFO,stdout,R +log4j.rootLogger=TRACE, stdout, R +log4j.logger.com.wisemapping=TRACE,stdout,R +log4j.logger.org.springframework=TRACE,stdout,R log4j.logger.org.hibernate.engine.internal.StatefulPersistenceContext=ERROR,stdout,R # Stdout logger � @@ -9,7 +9,7 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d %p %c - %m%n -# File Writter Logger � +# File Writer Logger � log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=wisemapping.log diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index a12cb311..a4e3c70d 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -1,6 +1,6 @@ + "http://tiles.apache.org/dtds/tiles-config_3_0.dtd"> @@ -37,16 +37,6 @@ - - - - - - - - - - @@ -68,19 +58,12 @@ - - - - - - - diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index 05361f7c..5808bbc6 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -15,7 +15,6 @@ - @@ -23,7 +22,6 @@ - @@ -58,31 +56,6 @@ authentication-failure-url="/c/login?login_error=2" login-processing-url="/c/perform-login"/> - - - - - - - - - - - - - - - - - - - - - - - diff --git a/wise-webapp/src/main/webapp/css/openid.css b/wise-webapp/src/main/webapp/css/openid.css deleted file mode 100644 index adea5107..00000000 --- a/wise-webapp/src/main/webapp/css/openid.css +++ /dev/null @@ -1,69 +0,0 @@ -/* - Simple OpenID Plugin - http://code.google.com/p/openid-selector/ - - This code is licensed under the New BSD License. -*/ - -#openid_form { - width: 580px; -} - -#openid_form legend { - font-weight: bold; -} - -#openid_choice { - display: none; -} - -#openid_input_area { - clear: both; - padding: 10px; -} - -#openid_btns, #openid_btns br { - clear: both; -} - -#openid_highlight { - padding: 3px; - background-color: #FFFCC9; - float: left; -} - -.openid_large_btn { - width: 100px; - height: 60px; -/* fix for IE 6 only: http://en.wikipedia.org/wiki/CSS_filter#Underscore_hack */ - _width: 102px; - _height: 62px; - - border: 1px solid #DDD; - margin: 3px; - float: left; -} - -.openid_small_btn { - width: 24px; - height: 24px; -/* fix for IE 6 only: http://en.wikipedia.org/wiki/CSS_filter#Underscore_hack */ - _width: 26px; - _height: 26px; - - border: 1px solid #DDD; - margin: 3px; - float: left; -} - -a.openid_large_btn:focus { - outline: none; -} - -a.openid_large_btn:focus { - -moz-outline-style: none; -} - -.openid_selected { - border: 4px solid #DDD; -} \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/js/openid-en.js b/wise-webapp/src/main/webapp/js/openid-en.js deleted file mode 100644 index 2b68c665..00000000 --- a/wise-webapp/src/main/webapp/js/openid-en.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - Simple OpenID Plugin - http://code.google.com/p/openid-selector/ - - This code is licensed under the New BSD License. -*/ - -var providers_large = { - google : { - name : 'Google', - url : 'https://www.google.com/accounts/o8/id' - }, - yahoo : { - name : 'Yahoo', - url : 'http://me.yahoo.com/' - }, - aol : { - name : 'AOL', - label : 'Enter your AOL screenname.', - url : 'http://openid.aol.com/{username}' - }, - myopenid : { - name : 'MyOpenID', - label : 'Enter your MyOpenID username.', - url : 'http://{username}.myopenid.com/' - }, - openid : { - name : 'OpenID', - label : 'Enter your OpenID.', - url : null - } -}; - -var providers_small = { - livejournal : { - name : 'LiveJournal', - label : 'Enter your Livejournal username.', - url : 'http://{username}.livejournal.com/' - }, - /* flickr: { - name: 'Flickr', - label: 'Enter your Flickr username.', - url: 'http://flickr.com/{username}/' - }, */ - /* technorati: { - name: 'Technorati', - label: 'Enter your Technorati username.', - url: 'http://technorati.com/people/technorati/{username}/' - }, */ - wordpress : { - name : 'Wordpress', - label : 'Enter your Wordpress.com username.', - url : 'http://{username}.wordpress.com/' - }, - blogger : { - name : 'Blogger', - label : 'Your Blogger account', - url : 'http://{username}.blogspot.com/' - }, - verisign : { - name : 'Verisign', - label : 'Your Verisign username', - url : 'http://{username}.pip.verisignlabs.com/' - }, - /* vidoop: { - name: 'Vidoop', - label: 'Your Vidoop username', - url: 'http://{username}.myvidoop.com/' - }, */ - /* launchpad: { - name: 'Launchpad', - label: 'Your Launchpad username', - url: 'https://launchpad.net/~{username}' - }, */ - claimid : { - name : 'ClaimID', - label : 'Your ClaimID username', - url : 'http://claimid.com/{username}' - }, - clickpass : { - name : 'ClickPass', - label : 'Enter your ClickPass username', - url : 'http://clickpass.com/public/{username}' - }, - google_profile : { - name : 'Google Profile', - label : 'Enter your Google Profile username', - url : 'http://www.google.com/profiles/{username}' - } -}; - -openid.locale = 'en'; -openid.sprite = 'en'; // reused in german& japan localization -openid.demo_text = 'In client demo mode. Normally would have submitted OpenID:'; -openid.signin_text = 'Sign-In'; -openid.image_title = 'log in with {provider}'; diff --git a/wise-webapp/src/main/webapp/js/openid-jquery.js b/wise-webapp/src/main/webapp/js/openid-jquery.js deleted file mode 100644 index 085ab3a8..00000000 --- a/wise-webapp/src/main/webapp/js/openid-jquery.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - Simple OpenID Plugin - http://code.google.com/p/openid-selector/ - - This code is licensed under the New BSD License. - */ - -var providers; -var openid; -(function ($) { - openid = { - version: '1.3', // version constant - demo: false, - demo_text: null, - cookie_expires: 6 * 30, // 6 months. - cookie_name: 'openid_provider', - cookie_path: '/', - - img_path: 'images/', - locale: null, // is set in openid-.js - sprite: null, // usually equals to locale, is set in - // openid-.js - signin_text: null, // text on submit button on the form - all_small: false, // output large providers w/ small icons - no_sprite: false, // don't use sprite image - image_title: '{provider}', // for image title - - input_id: null, - provider_url: null, - provider_id: null, - - /** - * Class constructor - * - * @return {Void} - */ - init: function (input_id) { - providers = $.extend({}, providers_large, providers_small); - var openid_btns = $('#openid_btns'); - this.input_id = input_id; - $('#openid_choice').show(); - $('#openid_input_area').empty(); - var i = 0; - // add box for each provider - var id, box; - for (id in providers_large) { - box = this.getBoxHTML(id, providers_large[id], (this.all_small ? 'small' : 'large'), i++); - openid_btns.append(box); - } - if (providers_small) { - openid_btns.append('
'); - for (id in providers_small) { - box = this.getBoxHTML(id, providers_small[id], 'small', i++); - openid_btns.append(box); - } - } - $('#openid_form').submit(this.submit); - var box_id = this.readCookie(); - if (box_id) { - this.signin(box_id, true); - } - }, - - /** - * @return {String} - */ - getBoxHTML: function (box_id, provider, box_size, index) { - if (this.no_sprite) { - var image_ext = box_size == 'small' ? '.ico.gif' : '.gif'; - return ''; - } - var x = box_size == 'small' ? -index * 24 : -index * 100; - var y = box_size == 'small' ? -60 : 0; - return ''; - }, - - /** - * Provider image click - * - * @return {Void} - */ - signin: function (box_id, onload) { - var provider = providers[box_id]; - if (!provider) { - return; - } - this.highlight(box_id); - this.setCookie(box_id); - this.provider_id = box_id; - this.provider_url = provider.url; - // prompt user for input? - if (provider.label) { - this.useInputBox(provider); - } else { - $('#openid_input_area').empty(); - if (!onload) { - $('#openid_form').submit(); - } - } - }, - - /** - * Sign-in button click - * - * @return {Boolean} - */ - submit: function () { - var url = openid.provider_url; - if (url) { - url = url.replace('{username}', $('#openid_username').val()); - openid.setOpenIdUrl(url); - } - if (openid.demo) { - alert(openid.demo_text + "\r\n" + document.getElementById(openid.input_id).value); - return false; - } - if (url && url.indexOf("javascript:") == 0) { - url = url.substr("javascript:".length); - eval(url); - return false; - } - return true; - }, - - /** - * @return {Void} - */ - setOpenIdUrl: function (url) { - var hidden = document.getElementById(this.input_id); - if (hidden != null) { - hidden.value = url; - } else { - $('#openid_form').append(''); - } - }, - - /** - * @return {Void} - */ - highlight: function (box_id) { - // remove previous highlight. - var highlight = $('#openid_highlight'); - if (highlight) { - highlight.replaceWith($('#openid_highlight a')[0]); - } - // add new highlight. - $('.' + box_id).wrap('
'); - }, - - setCookie: function (value) { - var date = new Date(); - date.setTime(date.getTime() + (this.cookie_expires * 24 * 60 * 60 * 1000)); - var expires = "; expires=" + date.toGMTString(); - document.cookie = this.cookie_name + "=" + value + expires + "; path=" + this.cookie_path; - }, - - readCookie: function () { - var nameEQ = this.cookie_name + "="; - var ca = document.cookie.split(';'); - for (var i = 0; i < ca.length; i++) { - var c = ca[i]; - while (c.charAt(0) == ' ') - c = c.substring(1, c.length); - if (c.indexOf(nameEQ) == 0) - return c.substring(nameEQ.length, c.length); - } - return null; - }, - - /** - * @return {Void} - */ - useInputBox: function (provider) { - var input_area = $('#openid_input_area'); - var html = ''; - var id = 'openid_username'; - var value = ''; - var label = provider.label; - var style = ''; - if (label) { - html = '

' + label + '

'; - } - if (provider.name == 'OpenID') { - id = this.input_id; - value = 'http://'; - style = 'background: #FFF url(' + this.img_path + 'openid-inputicon.gif) no-repeat scroll 0 50%; padding-left:18px;'; - } - html += '' - + ''; - input_area.empty(); - input_area.append(html); - $('#' + id).focus(); - }, - - setDemoMode: function (demoMode) { - this.demo = demoMode; - } - }; -})(jQuery); diff --git a/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp b/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp deleted file mode 100644 index 0c9f1337..00000000 --- a/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp +++ /dev/null @@ -1,18 +0,0 @@ -<%@page pageEncoding="UTF-8" %> -<%@include file="/jsp/init.jsp" %> - - -
-
- -
-
- - - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp b/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp deleted file mode 100644 index 0321a260..00000000 --- a/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp +++ /dev/null @@ -1,11 +0,0 @@ -<%@page pageEncoding="UTF-8" %> -<%@include file="/jsp/init.jsp" %> - -

- -

- -
- -
- diff --git a/wise-webapp/src/main/webapp/jsp/login.jsp b/wise-webapp/src/main/webapp/jsp/login.jsp index 7f4a5763..9d590e09 100644 --- a/wise-webapp/src/main/webapp/jsp/login.jsp +++ b/wise-webapp/src/main/webapp/jsp/login.jsp @@ -76,16 +76,9 @@ - -

- . -

-
-
diff --git a/wise-webapp/src/main/webapp/jsp/loginOpenId.jsp b/wise-webapp/src/main/webapp/jsp/loginOpenId.jsp deleted file mode 100644 index 6abbbb82..00000000 --- a/wise-webapp/src/main/webapp/jsp/loginOpenId.jsp +++ /dev/null @@ -1,56 +0,0 @@ -<%@page pageEncoding="UTF-8" %> -<%@ include file="/jsp/init.jsp" %> - -<%--@elvariable id="isHsql" type="boolean"--%> - - - - - - - - - - -
-

- -
-
-
-
- -
-
-
-
-
-
- - -
- -
-
- -
-
- -
-
-

- From 76ff1cc83d561804cb81930f5d3f36d85b6f9d52 Mon Sep 17 00:00:00 2001 From: Matias Arriola Date: Thu, 10 Jun 2021 00:13:26 +0000 Subject: [PATCH 04/98] Merged in feature/docker-docs (pull request #7) Add docker instructions and minor docs additions * Add docker folder with docs and docker-compose Add troubleshooting and docker sections to main README Approved-by: Paulo Veiga --- README.md | 20 +++ docker/README.md | 84 ++++++++++++ docker/docker-compose.yml | 24 ++++ docker/mysql-init/0001create-database.sql | 10 ++ docker/mysql-init/0002create-schemas.sql | 137 ++++++++++++++++++++ docker/mysql-init/0003apopulate-schemas.sql | 13 ++ 6 files changed, 288 insertions(+) create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml create mode 100644 docker/mysql-init/0001create-database.sql create mode 100644 docker/mysql-init/0002create-schemas.sql create mode 100644 docker/mysql-init/0003apopulate-schemas.sql diff --git a/README.md b/README.md index 2205aa10..bfea037e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ The full compilation of the project can be performed executing within /wise-webapp/target/wisemapping*.war will be generated. +### Compiling and running with docker-compose + +Check out the [docker section](./docker/README.md) + ### Testing The previously generated war can be deployed locally executing within the directory /wise-webapp the following command: @@ -49,6 +53,22 @@ To test the javascript frontend you then do: Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/ +## Troubleshooting + +
+ + mvn package fails with the error java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-11-openjdk-amd64/lib/libawt_xawt.so in Ubuntu + + + Make sure you have the jdk installed: `sudo apt-get install openjdk-11-jdk` +
+ +
+ mvn package does not generate the wisemapping.war file + + Run `mvn clean install -DskipTests` +
+ ## Maintenance diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..e0b6590c --- /dev/null +++ b/docker/README.md @@ -0,0 +1,84 @@ +This is an approach to compiling and installing wisemapping using docker and docker-compose. + +In this way you can run the app without installing specific java, maven, tomcat and mysql versions in the host machine just for this project. + +# Prerequisites + +Make sure you have [docker](https://docs.docker.com/engine/install/) and [docker-compose](https://docs.docker.com/compose/install/) installed. You might also want to [run docker without sudo](https://docs.docker.com/engine/install/linux-postinstall/) if you are on linux. + +# Compile wisemapping using docker + +This is not required to run the app using docker. You might skip this section if you already have the `war` file or if you want to compile it by yourself. + +We create a volume so the downloaded packages can be reused across different containers (a new container is created each time we run the image). This is run only once. + +``` +docker volume create --name maven-repo-wisemapping +``` + +Then we can run the following command from the project root: + +``` +docker run -it --rm --name wisemapping-compile \ + -v maven-repo-wisemapping:/root/.m2 \ + -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven:3-jdk-11 \ + mvn clean install -DskipTests +``` + +After that, you can find the result of the compilation in `wise-webapp/target/wisemapping.war`. + +# Run using docker-compose + +## Edit config + +### app.properties + +First of all, edit your `wise-webapp/src/main/webapp/WEB-INF/app.properties` to configure the app to use mysql. + +- Uncomment the `MySQL 5.X configuration properties` section +- Change the `database.url` line to this: `database.url=jdbc:mysql://db/wisemapping?useUnicode=yes&characterEncoding=UTF-8` (the host is "db" instead of "localhost") +- Change the default username and password +- Comment the `HSQL Configuration properties` section + +> Any time you make any config modification, you will have to re-compile the project, using the docker build shown before or any other method. + +### docker-compose.yml + +Review the `docker-compose.yml` file and edit it with your settings. +In the example provided the important bits are: + +- `/opt/wisemapping-db`: this is where the mysql database files will be stored in your machine. +- Change the default password for the database to match your app.properties password. Please don't keep "password"! +- You might want to remove the `ports:` section in the db service if you don't want your db exposed to the outside. + +``` +ports: + - 3306:3306 +``` + +- You might want to change the port mapping for web (by default it will run in port 8082) + +``` +ports: + - "8082:8080" +``` + +- Change `../wise-webapp/target/wisemapping.war` if you want to store the war file anywhere else in your machine. If you leave the default, the war file deployed will be overriden each time you build the app. You might not want that behavior. + +## Running + +Once the configs are ready, from this folder, run `docker-compose -p wise-webapp up -d` to run the web and the database containers as daemons. They will start automatically whith the machine. + +You can check your docker running containers with `docker ps`. + +To stop them you can run `docker-compose down` from this directory (doing this, they won't start automatically anymore). + +Check out docker and docker-compose docs for more container management utilities. + +## Areas for improvement + +- Create a Dockerfile to build wise-webapp using an `app.properties` file mounted from this directory (make building easier). +- Simplify this documentation, simplify the process +- Allow to pass configuration as environment variables form docker-compose + +If any of this can be improved, please submit a patch or issue. diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..732363f8 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,24 @@ +version: "3.3" +services: + db: + image: mysql:5.5 + volumes: + - /opt/wisemapping-db:/var/lib/mysql + - ./mysql-init/:/docker-entrypoint-initdb.d + environment: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: wisemapping + MYSQL_USER: wisemapping + MYSQL_PASSWORD: password + ports: + - 3306:3306 + restart: unless-stopped + web: + depends_on: + - db + image: tomcat:9 + volumes: + - ../wise-webapp/target/wisemapping.war:/usr/local/tomcat/webapps/ROOT.war + ports: + - "8082:8080" + restart: unless-stopped diff --git a/docker/mysql-init/0001create-database.sql b/docker/mysql-init/0001create-database.sql new file mode 100644 index 00000000..6d2cd226 --- /dev/null +++ b/docker/mysql-init/0001create-database.sql @@ -0,0 +1,10 @@ +# +# Command: mysql -u root -p < create_database.sql +# +DROP DATABASE IF EXISTS wisemapping; + +CREATE DATABASE IF NOT EXISTS wisemapping + CHARACTER SET = 'utf8' + COLLATE = 'utf8_unicode_ci'; +GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; +SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password'); \ No newline at end of file diff --git a/docker/mysql-init/0002create-schemas.sql b/docker/mysql-init/0002create-schemas.sql new file mode 100644 index 00000000..eba00226 --- /dev/null +++ b/docker/mysql-init/0002create-schemas.sql @@ -0,0 +1,137 @@ +# +# Command: mysql -u root -p < create_schemas.sql +# + +USE wisemapping; + +CREATE TABLE COLLABORATOR ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + email VARCHAR(255) + CHARACTER SET utf8 NOT NULL UNIQUE, + creation_date DATE +) + CHARACTER SET utf8; + +CREATE TABLE USER ( + colaborator_id INTEGER NOT NULL PRIMARY KEY, + authentication_type CHAR(1) + CHARACTER SET utf8 NOT NULL, + authenticator_uri VARCHAR(255) + CHARACTER SET utf8, + firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL, + lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL, + password VARCHAR(255) CHARACTER SET utf8 NOT NULL, + activation_code BIGINT(20) NOT NULL, + activation_date DATE, + allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0, + locale VARCHAR(5), + FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE MINDMAP ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(255) + CHARACTER SET utf8 NOT NULL, + description VARCHAR(255) + CHARACTER SET utf8 NOT NULL, + xml MEDIUMBLOB NOT NULL, + public BOOL NOT NULL DEFAULT 0, + creation_date DATETIME, + edition_date DATETIME, + creator_id INTEGER NOT NULL, + tags VARCHAR(1014) + CHARACTER SET utf8, + last_editor_id INTEGER NOT NULL, + FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE LABEL ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + title VARCHAR(30) + CHARACTER SET utf8 NOT NULL, + creator_id INTEGER NOT NULL, + parent_label_id INTEGER, + color VARCHAR(7) NOT NULL, + iconName VARCHAR(50) NOT NULL, + FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id), + FOREIGN KEY (parent_label_id) REFERENCES LABEL (id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE R_LABEL_MINDMAP ( + mindmap_id INTEGER NOT NULL, + label_id INTEGER NOT NULL, + PRIMARY KEY (mindmap_id, label_id), + FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), + FOREIGN KEY (label_id) REFERENCES LABEL (id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE MINDMAP_HISTORY +(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + xml MEDIUMBLOB NOT NULL, + mindmap_id INTEGER NOT NULL, + creation_date DATETIME, + editor_id INTEGER NOT NULL, + FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE COLLABORATION_PROPERTIES ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + starred BOOL NOT NULL DEFAULT 0, + mindmap_properties VARCHAR(512) + CHARACTER SET utf8 +) + CHARACTER SET utf8; + +CREATE TABLE COLLABORATION ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + colaborator_id INTEGER NOT NULL, + properties_id INTEGER NOT NULL, + mindmap_id INTEGER NOT NULL, + role_id INTEGER NOT NULL, + FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), + FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) + ON DELETE CASCADE + ON UPDATE NO ACTION, + FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE TAG ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + name VARCHAR(255) + CHARACTER SET utf8 NOT NULL, + user_id INTEGER NOT NULL, + FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +CREATE TABLE ACCESS_AUDITORY ( + id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, + login_date DATE, + user_id INTEGER NOT NULL, + FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) + ON DELETE CASCADE + ON UPDATE NO ACTION +) + CHARACTER SET utf8; + +COMMIT; \ No newline at end of file diff --git a/docker/mysql-init/0003apopulate-schemas.sql b/docker/mysql-init/0003apopulate-schemas.sql new file mode 100644 index 00000000..a4daf933 --- /dev/null +++ b/docker/mysql-init/0003apopulate-schemas.sql @@ -0,0 +1,13 @@ +# +# Command: mysql -u root -p < apopulate_schemas.sql +# + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); + +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); +INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) + VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); + +COMMIT; From b3e26caee47a85089c65a1bcf02765554c9fd0e2 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 24 Dec 2021 18:03:23 -0800 Subject: [PATCH 05/98] Fix major update integrating with external wisemapping frond end --- .gitignore | 1 + README.md | 54 +- bitbucket-pipelines.yml | 12 + core-js/pom.xml | 94 - core-js/src/main/javascript/Functions.js | 62 - core-js/src/main/javascript/Utils.js | 61 - core-js/src/main/javascript/header.js | 19 - core-js/src/test/javascript/testSuite.js | 10 - mindplot/pom.xml | 427 - mindplot/src/main/javascript/.gitignore | 1 - .../src/main/javascript/ActionDispatcher.js | 110 - mindplot/src/main/javascript/ActionIcon.js | 62 - mindplot/src/main/javascript/CentralTopic.js | 77 - mindplot/src/main/javascript/Command.js | 65 - .../src/main/javascript/ConnectionLine.js | 204 - mindplot/src/main/javascript/ControlPoint.js | 202 - mindplot/src/main/javascript/Designer.js | 1027 -- .../main/javascript/DesignerActionRunner.js | 54 - .../src/main/javascript/DesignerKeyboard.js | 397 - mindplot/src/main/javascript/DesignerModel.js | 188 - .../main/javascript/DesignerUndoManager.js | 83 - mindplot/src/main/javascript/DragConnector.js | 113 - mindplot/src/main/javascript/DragManager.js | 148 - mindplot/src/main/javascript/DragPivot.js | 228 - mindplot/src/main/javascript/DragTopic.js | 215 - mindplot/src/main/javascript/EditorOptions.js | 25 - .../src/main/javascript/EditorProperties.js | 40 - mindplot/src/main/javascript/Events.js | 41 - mindplot/src/main/javascript/Icon.js | 60 - mindplot/src/main/javascript/IconGroup.js | 340 - mindplot/src/main/javascript/ImageIcon.js | 163 - mindplot/src/main/javascript/Keyboard.js | 33 - mindplot/src/main/javascript/LinkIcon.js | 68 - .../main/javascript/LocalStorageManager.js | 63 - mindplot/src/main/javascript/MainTopic.js | 152 - mindplot/src/main/javascript/Messages.js | 44 - .../main/javascript/MultilineTextEditor.js | 313 - mindplot/src/main/javascript/NodeGraph.js | 215 - mindplot/src/main/javascript/NoteIcon.js | 81 - mindplot/src/main/javascript/Options.js | 13 - .../src/main/javascript/PersistenceManager.js | 84 - mindplot/src/main/javascript/Relationship.js | 330 - .../src/main/javascript/RelationshipPivot.js | 160 - .../main/javascript/RestPersistenceManager.js | 163 - mindplot/src/main/javascript/ScreenManager.js | 149 - .../src/main/javascript/ShrinkConnector.js | 107 - .../javascript/StandaloneActionDispatcher.js | 360 - mindplot/src/main/javascript/TextEditor.js | 268 - .../src/main/javascript/TextEditorFactory.js | 28 - mindplot/src/main/javascript/Topic.js | 1356 --- .../main/javascript/TopicEventDispatcher.js | 78 - mindplot/src/main/javascript/TopicFeature.js | 91 - mindplot/src/main/javascript/TopicStyle.js | 132 - mindplot/src/main/javascript/Workspace.js | 227 - .../commands/AddFeatureToTopicCommand.js | 66 - .../commands/AddRelationshipCommand.js | 50 - .../javascript/commands/AddTopicCommand.js | 93 - .../commands/ChangeFeatureToTopicCommand.js | 61 - .../main/javascript/commands/DeleteCommand.js | 183 - .../javascript/commands/DragTopicCommand.js | 100 - .../commands/GenericFunctionCommand.js | 96 - .../commands/MoveControlPointCommand.js | 113 - .../commands/RemoveFeatureFromTopicCommand.js | 58 - mindplot/src/main/javascript/footer.js | 5 - mindplot/src/main/javascript/header.js | 36 - .../javascript/layout/AbstractBasicSorter.js | 90 - .../main/javascript/layout/BalancedSorter.js | 275 - .../src/main/javascript/layout/ChangeEvent.js | 70 - .../layout/ChildrenSorterStrategy.js | 68 - .../src/main/javascript/layout/EventBus.js | 45 - .../javascript/layout/EventBusDispatcher.js | 96 - .../src/main/javascript/layout/GridSorter.js | 92 - .../main/javascript/layout/LayoutManager.js | 266 - mindplot/src/main/javascript/layout/Node.js | 221 - .../main/javascript/layout/OriginalLayout.js | 256 - .../main/javascript/layout/RootedTreeSet.js | 395 - .../main/javascript/layout/SymmetricSorter.js | 282 - .../bootstrap/BootstrapDialog.Request.js | 49 - .../libraries/bootstrap/BootstrapDialog.js | 111 - .../bootstrap/css/bootstrap-colorpicker.css | 214 - .../css/bootstrap-colorpicker.min.css | 9 - .../bootstrap/css/bootstrap-theme.css | 347 - .../bootstrap/css/bootstrap-theme.css.map | 1 - .../bootstrap/css/bootstrap-theme.min.css | 7 - .../libraries/bootstrap/css/bootstrap.css | 5785 ---------- .../libraries/bootstrap/css/bootstrap.css.map | 1 - .../fonts/glyphicons-halflings-regular.eot | Bin 20335 -> 0 bytes .../fonts/glyphicons-halflings-regular.svg | 229 - .../fonts/glyphicons-halflings-regular.ttf | Bin 41280 -> 0 bytes .../fonts/glyphicons-halflings-regular.woff | Bin 23320 -> 0 bytes .../alpha-horizontal.png | Bin 3635 -> 0 bytes .../bootstrap-colorpicker/hue-horizontal.png | Bin 2837 -> 0 bytes .../img/bootstrap-colorpicker/saturation.png | Bin 8817 -> 0 bytes .../img/glyphicons-halflings-blue.png | Bin 4207 -> 0 bytes .../bootstrap/js/bootstrap-colorpicker.js | 951 -- .../bootstrap/js/bootstrap-colorpicker.min.js | 1 - .../libraries/bootstrap/js/bootstrap.js | 1951 ---- .../libraries/bootstrap/js/bootstrap.min.js | 6 - .../libraries/hotkeys/jquery.hotkeys.js | 110 - .../libraries/jquery/jquery-2.1.0.js | 9111 ---------------- .../libraries/jquery/jquery-2.1.0.min.js | 4 - .../libraries/jquery/jquery.mousewheel.min.js | 8 - .../libraries/less/less-1.4.2.min.js | 11 - .../libraries/less/less-1.6.2.min.js | 16 - .../mootools-core-1.4.5-full-nocompat-yc.js | 574 - .../libraries/underscorejs/underscore-min.js | 5 - .../src/main/javascript/model/FeatureModel.js | 89 - .../src/main/javascript/model/IMindmap.js | 179 - .../src/main/javascript/model/INodeModel.js | 419 - .../src/main/javascript/model/IconModel.js | 48 - .../src/main/javascript/model/LinkModel.js | 75 - mindplot/src/main/javascript/model/Mindmap.js | 184 - .../src/main/javascript/model/NodeModel.js | 241 - .../src/main/javascript/model/NoteModel.js | 49 - .../javascript/model/RelationshipModel.js | 139 - .../persistence/Beta2PelaMigrator.js | 54 - .../javascript/persistence/ModelCodeName.js | 27 - .../persistence/Pela2TangoMigrator.js | 94 - .../persistence/XMLSerializerFactory.js | 88 - .../persistence/XMLSerializer_Beta.js | 295 - .../persistence/XMLSerializer_Pela.js | 495 - .../persistence/XMLSerializer_Tango.js | 27 - .../src/main/javascript/util/FadeEffect.js | 45 - mindplot/src/main/javascript/util/Shape.js | 128 - .../javascript/widget/ColorPalettePanel.js | 101 - .../src/main/javascript/widget/FloatingTip.js | 64 - .../main/javascript/widget/FontFamilyPanel.js | 37 - .../main/javascript/widget/FontSizePanel.js | 37 - mindplot/src/main/javascript/widget/IMenu.js | 111 - .../src/main/javascript/widget/IconPanel.js | 67 - .../widget/KeyboardShortcutTooltip.js | 66 - .../src/main/javascript/widget/LinkEditor.js | 152 - .../main/javascript/widget/LinkIconTooltip.js | 76 - .../javascript/widget/ListToolbarPanel.js | 51 - mindplot/src/main/javascript/widget/Menu.js | 495 - .../javascript/widget/ModalDialogNotifier.js | 53 - .../src/main/javascript/widget/NoteEditor.js | 92 - .../src/main/javascript/widget/ToolbarItem.js | 76 - .../main/javascript/widget/ToolbarNotifier.js | 46 - .../main/javascript/widget/ToolbarPaneItem.js | 122 - .../main/javascript/widget/TopicShapePanel.js | 37 - .../src/main/resources/messages_ca.properties | 60 - .../src/main/resources/messages_de.properties | 59 - .../src/main/resources/messages_en.properties | 61 - .../src/main/resources/messages_es.properties | 60 - .../src/main/resources/messages_fr.properties | 61 - .../main/resources/messages_pt_BR.properties | 52 - .../main/resources/messages_zh_CN.properties | 50 - .../main/resources/messages_zh_TW.properties | 52 - .../src/test/javascript/BalancedTestSuite.js | 284 - .../src/test/javascript/DesignerTestSuite.js | 68 - .../src/test/javascript/EventsTestSuite.js | 43 - mindplot/src/test/javascript/FreeTestSuite.js | 254 - .../src/test/javascript/SymmetricTestSuite.js | 81 - mindplot/src/test/javascript/TestSuite.js | 6 - mindplot/src/test/javascript/lib/bootstrap.js | 1 - mindplot/src/test/javascript/lib/core.js | 1 - .../src/test/javascript/lib/jquery-1.8.2.js | 9440 ----------------- mindplot/src/test/javascript/lib/jquery.js | 1 - .../src/test/javascript/lib/web2d.svg-min.js | 1 - mindplot/src/test/javascript/simpleTest.js | 128 - .../src/test/javascript/static/layout.html | 195 - .../src/test/javascript/static/palette.html | 41 - .../src/test/javascript/static/sample.xml | 7 - .../static/test/BalancedTestSuite.js | 388 - .../javascript/static/test/FreeTestSuite.js | 482 - .../static/test/SymmetricTestSuite.js | 266 - .../test/javascript/static/test/TestSuite.js | 486 - .../javascript/static/test/raphael-min.js | 8 - .../javascript/static/test/raphael-plugins.js | 29 - mindplot/src/test/resources/welcome.xml | 48 - pom.xml | 72 +- web2d/pom.xml | 98 - web2d/src/main/javascript/Arrow.js | 54 - web2d/src/main/javascript/CurvedLine.js | 120 - web2d/src/main/javascript/Element.js | 307 - web2d/src/main/javascript/Elipse.js | 37 - web2d/src/main/javascript/Font.js | 82 - web2d/src/main/javascript/Group.js | 132 - web2d/src/main/javascript/Image.js | 41 - web2d/src/main/javascript/Issues.txt | 17 - web2d/src/main/javascript/Line.js | 69 - web2d/src/main/javascript/Point.js | 53 - web2d/src/main/javascript/PolyLine.js | 77 - web2d/src/main/javascript/Rect.js | 51 - web2d/src/main/javascript/Text.js | 95 - web2d/src/main/javascript/Toolkit.js | 82 - web2d/src/main/javascript/Workspace.js | 196 - web2d/src/main/javascript/header.js | 24 - .../src/main/javascript/peer/svg/ArialFont.js | 33 - .../src/main/javascript/peer/svg/ArrowPeer.js | 97 - .../javascript/peer/svg/CurvedLinePeer.js | 200 - .../main/javascript/peer/svg/ElementPeer.js | 240 - .../main/javascript/peer/svg/ElipsePeer.js | 59 - web2d/src/main/javascript/peer/svg/Font.js | 92 - .../src/main/javascript/peer/svg/GroupPeer.js | 131 - .../src/main/javascript/peer/svg/ImagePeer.js | 47 - .../src/main/javascript/peer/svg/LinePeer.js | 61 - .../main/javascript/peer/svg/PolyLinePeer.js | 104 - .../src/main/javascript/peer/svg/RectPeer.js | 57 - .../main/javascript/peer/svg/TahomaFont.js | 33 - .../src/main/javascript/peer/svg/TextPeer.js | 195 - .../src/main/javascript/peer/svg/TimesFont.js | 33 - .../main/javascript/peer/svg/VerdanaFont.js | 33 - .../main/javascript/peer/svg/WorkspacePeer.js | 108 - .../main/javascript/peer/utils/EventUtils.js | 40 - .../javascript/peer/utils/TransformUtils.js | 38 - web2d/src/test/javascript/jquery-2.1.0.js | 4 - .../javascript/jsUnit/ElementsTestSuite.html | 286 - .../javascript/jsUnit/WorkspaceTestSuite.html | 135 - .../test/javascript/mootools-core-1.4.5.js | 76 - web2d/src/test/javascript/render/arrow.html | 109 - .../test/javascript/render/curvedLine.html | 111 - web2d/src/test/javascript/render/events.html | 301 - web2d/src/test/javascript/render/font.html | 161 - web2d/src/test/javascript/render/group.html | 524 - web2d/src/test/javascript/render/line.html | 163 - .../src/test/javascript/render/polyLine.html | 214 - .../src/test/javascript/render/prototype.html | 198 - web2d/src/test/javascript/render/rect.html | 132 - web2d/src/test/javascript/render/shapes.html | 335 - web2d/src/test/javascript/render/text.html | 136 - web2d/src/test/javascript/render/utils.js | 59 - .../src/test/javascript/render/workspace.html | 347 - wise-editor/doc/ConfigParameters.md | 46 - wise-editor/doc/ImplementingPersistence.md | 86 - wise-editor/doc/Integration.md | 71 - wise-editor/pom.xml | 88 - wise-editor/src/main/resources/web.xml | 9 - wise-editor/src/main/webapp/WEB-INF/web.xml | 9 - wise-editor/src/main/webapp/bootstrap | 1 - wise-editor/src/main/webapp/c/export.htm | 115 - wise-editor/src/main/webapp/c/map/export.htm | 117 - wise-editor/src/main/webapp/c/publish.htm | 99 - .../main/webapp/css/widget/colorPalette.css | 1 - .../main/webapp/css/widget/colorPalette.html | 1 - .../src/main/webapp/html/container.html | 68 - .../src/main/webapp/html/container.json | 16 - wise-editor/src/main/webapp/html/drag.html | 221 - wise-editor/src/main/webapp/html/editor.html | 145 - .../src/main/webapp/html/embedded.html | 138 - .../src/main/webapp/html/viewmode.html | 66 - wise-editor/src/main/webapp/index.html | 23 - wise-editor/src/main/webapp/js/bootstrap.js | 1 - wise-editor/src/main/webapp/js/core.js | 1 - wise-editor/src/main/webapp/js/editor.js | 202 - wise-editor/src/main/webapp/js/hotkeys.js | 1 - .../src/main/webapp/js/jquery-mousewheel.js | 1 - wise-editor/src/main/webapp/js/jquery.js | 1 - wise-editor/src/main/webapp/js/less.js | 1 - .../src/main/webapp/js/mindplot-min.js | 75 - .../src/main/webapp/js/mootools-core.js | 1 - wise-editor/src/main/webapp/js/underscore.js | 1 - .../src/main/webapp/js/underscorejs.js | 1 - .../src/main/webapp/samples/complex.xml | 352 - .../src/main/webapp/samples/emptyNodes.xml | 239 - wise-editor/src/main/webapp/samples/huge.xml | 386 - wise-editor/src/main/webapp/samples/issue.xml | 120 - .../src/main/webapp/samples/sample2.xml | 29 - .../src/main/webapp/samples/sample3.xml | 9 - .../src/main/webapp/samples/sample4.xml | 10 - .../main/webapp/samples/welcome-reloaded.xml | 48 - .../src/main/webapp/samples/welcome.xml | 48 - wise-ui/pom.xml | 78 + wise-webapp/doc/REST Services.md | 8 +- wise-webapp/pom.xml | 194 +- .../com/wisemapping/dao/MindmapManager.java | 8 +- .../wisemapping/dao/MindmapManagerImpl.java | 12 +- .../java/com/wisemapping/dao/UserManager.java | 10 +- .../com/wisemapping/dao/UserManagerImpl.java | 13 +- .../exceptions/ClientException.java | 2 +- .../exceptions/EmailNotExistsException.java | 18 +- .../GoogleChromeFrameRequiredException.java | 23 - .../exceptions/MapCouldNotFoundException.java | 3 +- .../exceptions/SessionExpiredException.java | 2 +- .../UnsupportedBrowserException.java | 23 - .../wisemapping/exporter/ExportFormat.java | 4 +- .../exporter/ExportProperties.java | 4 +- .../com/wisemapping/exporter/Exporter.java | 4 +- .../wisemapping/exporter/ExporterFactory.java | 6 +- .../exporter/FreemindExporter.java | 17 +- .../wisemapping/exporter/XSLTExporter.java | 16 +- .../filter/BrowserSupportInterceptor.java | 75 - .../filter/RequestPropertiesInterceptor.java | 11 +- .../filter/SupportedUserAgent.java | 6 +- .../filter/UserLocaleInterceptor.java | 3 - .../com/wisemapping/importer/Importer.java | 2 +- .../importer/JaxbCDATAMarshaller.java | 2 +- .../wisemapping/importer/VersionNumber.java | 3 +- .../importer/freemind/FreemindConstant.java | 39 +- .../freemind/FreemindIconConverter.java | 7 +- .../importer/freemind/FreemindImporter.java | 37 +- .../java/com/wisemapping/mail/Mailer.java | 8 +- .../wisemapping/mail/NotificationService.java | 2 +- .../mail/NotifyingExceptionResolver.java | 2 +- .../com/wisemapping/model/Collaboration.java | 4 +- .../com/wisemapping/model/Collaborator.java | 8 +- .../main/java/com/wisemapping/model/Font.java | 2 +- .../wisemapping/model/MindMapCriteria.java | 2 +- .../java/com/wisemapping/model/Mindmap.java | 10 +- .../com/wisemapping/model/MindmapIcon.java | 4 +- .../com/wisemapping/model/MindmapIcons.java | 6 +- .../com/wisemapping/model/ShapeStyle.java | 2 +- .../main/java/com/wisemapping/model/User.java | 1 - .../wisemapping/rest/AccountController.java | 13 +- .../com/wisemapping/rest/AdminController.java | 31 +- .../com/wisemapping/rest/BaseController.java | 13 +- ...bugMappingJacksonHttpMessageConverter.java | 5 +- .../com/wisemapping/rest/LabelController.java | 12 +- .../wisemapping/rest/MindmapController.java | 155 +- .../com/wisemapping/rest/MindmapFilter.java | 6 +- .../rest/TransformerController.java | 10 +- .../com/wisemapping/rest/UserController.java | 119 + .../wisemapping/rest/ValidationException.java | 2 +- .../rest/model/RestCollaborationList.java | 5 +- .../rest/model/RestCollaborator.java | 2 +- .../wisemapping/rest/model/RestErrors.java | 6 +- .../com/wisemapping/rest/model/RestLabel.java | 2 +- .../wisemapping/rest/model/RestMindmap.java | 10 +- .../rest/model/RestMindmapHistory.java | 8 +- .../rest/model/RestMindmapHistoryList.java | 2 +- .../rest/model/RestMindmapInfo.java | 14 +- .../rest/model/RestMindmapList.java | 5 +- .../com/wisemapping/rest/model/RestUser.java | 17 +- .../rest/model/RestUserRegistration.java | 76 + .../rest/view/ImportTransformationView.java | 7 +- .../wisemapping/rest/view/TransformView.java | 6 +- .../AuthenticationSuccessHandler.java | 2 +- .../DefaultPasswordEncoderFactories.java | 2 +- .../security/LegacyPasswordEncoder.java | 17 +- .../com/wisemapping/security/UserDetails.java | 4 +- .../security/aop/BaseSecurityAdvice.java | 3 +- .../security/aop/UpdateSecurityAdvise.java | 1 - .../security/aop/ViewBaseSecurityAdvise.java | 4 +- .../service/HibernateAppListener.java | 2 +- .../com/wisemapping/service/LabelService.java | 2 +- .../com/wisemapping/service/LockInfo.java | 2 +- .../wisemapping/service/LockManagerImpl.java | 2 +- .../wisemapping/service/MindmapService.java | 4 +- .../wisemapping/service/RecaptchaService.java | 32 +- .../service/RegistrationException.java | 9 + .../com/wisemapping/service/UserService.java | 22 +- .../wisemapping/service/UserServiceImpl.java | 2 +- .../com/wisemapping/util/Application.java | 4 +- .../com/wisemapping/util/ApplicationType.java | 4 +- .../java/com/wisemapping/util/Browser.java | 4 +- .../com/wisemapping/util/BrowserType.java | 4 +- .../java/com/wisemapping/util/DeviceType.java | 2 +- .../com/wisemapping/util/Manufacturer.java | 2 +- .../com/wisemapping/util/OperatingSystem.java | 6 +- .../com/wisemapping/util/RenderingEngine.java | 2 +- .../java/com/wisemapping/util/TimeUtils.java | 2 +- .../java/com/wisemapping/util/UserAgent.java | 7 +- .../util/VelocityEngineWrapper.java | 9 +- .../java/com/wisemapping/util/Version.java | 7 +- .../validator/MapInfoValidator.java | 2 +- .../com/wisemapping/validator/Messages.java | 2 +- .../wisemapping/validator/UserValidator.java | 28 +- .../java/com/wisemapping/validator/Utils.java | 4 +- .../wisemapping/view/CollaboratorBean.java | 6 +- .../com/wisemapping/view/MindMapBean.java | 8 +- .../webmvc/ApplicationContextInitializer.java | 14 +- .../webmvc/ExtensionsController.java | 43 - .../wisemapping/webmvc/LoginController.java | 13 - .../wisemapping/webmvc/MindmapController.java | 61 - .../webmvc/PublicPagesController.java | 16 - .../wisemapping/webmvc/UsersController.java | 111 +- .../bootstrap/12px/bootstrap3.1.tar.gz | Bin 217358 -> 0 bytes .../bootstrap/13px/bootstrap3.1.tar.gz | Bin 205535 -> 0 bytes .../src/main/resources/messages_ca.properties | 2 +- .../src/main/resources/messages_de.properties | 2 +- .../src/main/resources/messages_en.properties | 31 +- .../src/main/resources/messages_es.properties | 2 +- .../src/main/resources/messages_fr.properties | 2 +- .../src/main/resources/messages_it.properties | 2 +- .../main/resources/messages_pt_BR.properties | 2 +- .../main/resources/messages_zh_CN.properties | 2 +- .../main/resources/messages_zh_TW.properties | 2 +- .../src/main/webapp/WEB-INF/app.properties | 13 - .../webapp/WEB-INF/classes/log4j.properties | 8 +- .../main/webapp/WEB-INF/defs/definitions.xml | 153 +- .../main/webapp/WEB-INF/wisemapping-rest.xml | 5 +- .../webapp/WEB-INF/wisemapping-security.xml | 23 +- .../webapp/WEB-INF/wisemapping-servlet.xml | 31 +- wise-webapp/src/main/webapp/bootstrap | 1 - .../bootstrap/css/bootstrap-colorpicker.css | 0 .../css/bootstrap-colorpicker.min.css | 0 .../webapp/bootstrap/css/bootstrap-theme.css | 0 .../bootstrap/css/bootstrap-theme.css.map | 0 .../bootstrap/css/bootstrap-theme.min.css | 0 .../main/webapp/bootstrap/css/bootstrap.css | 0 .../webapp/bootstrap/css/bootstrap.css.map | 0 .../webapp/bootstrap/css/bootstrap.min.css | 0 .../fonts/glyphicons-halflings-regular.eot | 0 .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | 0 .../fonts/glyphicons-halflings-regular.woff | 0 .../alpha-horizontal.png | 0 .../img/bootstrap-colorpicker/alpha.png | 0 .../bootstrap-colorpicker/hue-horizontal.png | 0 .../img/bootstrap-colorpicker/hue.png | 0 .../img/bootstrap-colorpicker/saturation.png | 0 .../img/glyphicons-halflings-blue.png | 0 .../src/main/webapp}/css/bootstrap.min.css | 0 .../src/main/webapp/css/compatibility.less | 0 .../src/main/webapp/css}/css/embedded.less | 0 .../main/webapp/css/{ => css}/pageHeaders.css | 0 .../webapp/css/{ => css}/pageTemplate.css | 0 wise-webapp/src/main/webapp/css/css/skin.less | 3 + .../src/main/webapp/css/editor.less | 2 +- wise-webapp/src/main/webapp/css/embedded.less | 1 - .../src/main/webapp/css/header.less | 0 .../src/main/webapp/css/mindmapList.less | 401 - .../src/main/webapp/css/toolbar.less | 14 +- .../main/webapp/css}/widget/colorPalette.css | 0 .../main/webapp/css}/widget/colorPalette.html | 0 .../src/main/webapp/css/widget/skin2.less | 0 .../webapp/doc/rest/css/highlight.default.css | 135 - .../src/main/webapp/doc/rest/css/screen.css | 1070 -- .../main/webapp/doc/rest/images/throbber.gif | Bin 9257 -> 0 bytes .../src/main/webapp/doc/rest/index.html | 78 - .../main/webapp/doc/rest/lib/backbone-min.js | 38 - .../webapp/doc/rest/lib/handlebars-1.0.0.js | 2278 ---- .../webapp/doc/rest/lib/highlight.7.3.pack.js | 1 - .../webapp/doc/rest/lib/jquery-1.8.0.min.js | 2 - .../webapp/doc/rest/lib/jquery.ba-bbq.min.js | 18 - .../webapp/doc/rest/lib/jquery.slideto.min.js | 1 - .../webapp/doc/rest/lib/jquery.wiggle.min.js | 8 - .../main/webapp/doc/rest/lib/shred.bundle.js | 2765 ----- .../main/webapp/doc/rest/lib/shred/content.js | 193 - .../src/main/webapp/doc/rest/lib/swagger.js | 1244 --- .../webapp/doc/rest/lib/underscore-min.js | 32 - .../src/main/webapp/doc/rest/swagger-ui.js | 2115 ---- .../main/webapp/doc/rest/swagger-ui.min.js | 1 - wise-webapp/src/main/webapp/favicon.ico | Bin 151894 -> 0 bytes .../src/main/webapp/icons/arrow_down.gif | Bin .../src/main/webapp/icons/arrow_down.png | Bin .../src/main/webapp/icons/arrow_left.png | Bin .../src/main/webapp/icons/arrow_merge.png | Bin .../src/main/webapp/icons/arrow_right.png | Bin .../src/main/webapp/icons/arrow_up.png | Bin .../icons/arrowc_rotate_anticlockwise.png | Bin .../webapp/icons/arrowc_rotate_clockwise.png | Bin .../main/webapp/icons/arrowc_turn_left.png | Bin .../main/webapp/icons/arrowc_turn_right.png | Bin .../src/main/webapp/icons/bomb.png | Bin .../src/main/webapp/icons/bulb_light_off.png | Bin .../src/main/webapp/icons/bulb_light_on.png | Bin .../src/main/webapp/icons/bullet_black.png | Bin .../src/main/webapp/icons/bullet_blue.png | Bin .../src/main/webapp/icons/bullet_green.png | Bin .../src/main/webapp/icons/bullet_orange.png | Bin .../src/main/webapp/icons/bullet_pink.png | Bin .../src/main/webapp/icons/bullet_purple.png | Bin .../src/main/webapp/icons/bullet_red.png | Bin .../src/main/webapp/icons/chart_bar.png | Bin .../src/main/webapp/icons/chart_curve.png | Bin .../src/main/webapp/icons/chart_line.png | Bin .../main/webapp/icons/chart_organisation.png | Bin .../src/main/webapp/icons/chart_pie.png | Bin .../src/main/webapp/icons/close.png | Bin .../src/main/webapp/icons/conn_connect.png | Bin .../src/main/webapp/icons/conn_disconnect.png | Bin .../src/main/webapp/icons/face_crying.png | Bin .../src/main/webapp/icons/face_plain.png | Bin .../src/main/webapp/icons/face_sad.png | Bin .../src/main/webapp/icons/face_smile-big.png | Bin .../src/main/webapp/icons/face_smile.png | Bin .../src/main/webapp/icons/face_surprise.png | Bin .../src/main/webapp/icons/face_wink.png | Bin .../src/main/webapp/icons/flag_blue.png | Bin .../src/main/webapp/icons/flag_green.png | Bin .../src/main/webapp/icons/flag_orange.png | Bin .../src/main/webapp/icons/flag_pink.png | Bin .../src/main/webapp/icons/flag_purple.png | Bin .../src/main/webapp/icons/flag_yellow.png | Bin .../src/main/webapp/icons/funy_angel.png | Bin .../src/main/webapp/icons/funy_devilish.png | Bin .../src/main/webapp/icons/funy_glasses.png | Bin .../src/main/webapp/icons/funy_grin.png | Bin .../src/main/webapp/icons/funy_kiss.png | Bin .../src/main/webapp/icons/funy_monkey.png | Bin .../src/main/webapp/icons/gener_female.png | Bin .../src/main/webapp/icons/gener_male.png | Bin .../src/main/webapp/icons/hard_cd.png | Bin .../src/main/webapp/icons/hard_computer.png | Bin .../src/main/webapp/icons/hard_controller.png | Bin .../src/main/webapp/icons/hard_drive_cd.png | Bin .../main/webapp/icons/hard_driver_disk.png | Bin .../src/main/webapp/icons/hard_ipod.png | Bin .../src/main/webapp/icons/hard_keyboard.png | Bin .../src/main/webapp/icons/hard_mouse.png | Bin .../src/main/webapp/icons/hard_printer.png | Bin .../src/main/webapp/icons/lock_close.png | Bin .../src/main/webapp/icons}/lock_open.png | Bin .../src/main/webapp/icons/mail_edit.png | Bin .../src/main/webapp/icons/mail_envelop.png | Bin .../src/main/webapp/icons/mail_list.png | Bin .../src/main/webapp/icons/mail_mailbox.png | Bin .../src/main/webapp/icons/money_coins.png | Bin .../src/main/webapp/icons}/money_dollar.png | Bin .../src/main/webapp/icons}/money_euro.png | Bin .../src/main/webapp/icons/money_money.png | Bin .../src/main/webapp/icons}/money_pound.png | Bin .../src/main/webapp/icons/money_ruby.png | Bin .../src/main/webapp/icons}/money_yen.png | Bin .../src/main/webapp/icons/number_1.png | Bin .../src/main/webapp/icons/number_2.png | Bin .../src/main/webapp/icons/number_3.png | Bin .../src/main/webapp/icons/number_4.png | Bin .../src/main/webapp/icons/number_5.png | Bin .../src/main/webapp/icons/number_6.png | Bin .../src/main/webapp/icons/number_7.png | Bin .../src/main/webapp/icons/number_8.png | Bin .../src/main/webapp/icons/number_9.png | Bin .../src/main/webapp/icons/object_bell.png | Bin .../src/main/webapp/icons/object_cake.png | Bin .../src/main/webapp/icons/object_camera.png | Bin .../main/webapp/icons/object_clanbomber.png | Bin .../src/main/webapp/icons/object_clip.png | Bin .../src/main/webapp/icons/object_house.png | Bin .../src/main/webapp/icons/object_key.png | Bin .../main/webapp/icons/object_magnifier.png | Bin .../src/main/webapp/icons/object_music.png | Bin .../src/main/webapp/icons/object_palette.png | Bin .../src/main/webapp/icons/object_pencil.png | Bin .../src/main/webapp/icons/object_phone.png | Bin .../src/main/webapp/icons/object_rainbow.png | Bin .../src/main/webapp/icons/object_star.png | Bin .../src/main/webapp/icons/object_wizard.png | Bin .../src/main/webapp/icons/onoff_add.png | Bin .../src/main/webapp/icons/onoff_clock.png | Bin .../src/main/webapp/icons/onoff_clock_red.png | Bin .../src/main/webapp/icons/onoff_delete.png | Bin .../webapp/icons/onoff_status_offline.png | Bin .../main/webapp/icons/onoff_status_online.png | Bin .../src/main/webapp/icons/people_female1.png | Bin .../src/main/webapp/icons/people_female2.png | Bin .../src/main/webapp/icons/people_group.png | Bin .../src/main/webapp/icons/people_male1.png | Bin .../src/main/webapp/icons/people_male2.png | Bin .../src/main/webapp/icons/sign_cancel.png | Bin .../src/main/webapp/icons/sign_closed.png | Bin .../main/webapp/icons/sign_exclamation.png | Bin .../src/main/webapp/icons/sign_help.png | Bin .../src/main/webapp/icons/sign_info.png | Bin .../src/main/webapp/icons/sign_stop.png | Bin .../src/main/webapp/icons/sign_warning.png | Bin .../src/main/webapp/icons/soft_bug.png | Bin .../src/main/webapp/icons/soft_cursor.png | Bin .../src/main/webapp/icons/soft_database.png | Bin .../main/webapp/icons/soft_database_table.png | Bin .../src/main/webapp/icons/soft_feed.png | Bin .../main/webapp/icons/soft_folder_explore.png | Bin .../src/main/webapp/icons/soft_penguin.png | Bin .../src/main/webapp/icons/soft_rss.png | Bin .../main/webapp/icons/soft_stuff_folder.png | Bin .../main/webapp/icons/sport_basketball.png | Bin .../src/main/webapp/icons/sport_football.png | Bin .../src/main/webapp/icons/sport_golf.png | Bin .../src/main/webapp/icons/sport_raquet.png | Bin .../main/webapp/icons/sport_shuttlecock.png | Bin .../src/main/webapp/icons/sport_soccer.png | Bin .../src/main/webapp/icons/sport_tennis.png | Bin .../src/main/webapp/icons}/tag_blue.png | Bin .../src/main/webapp/icons}/tag_blue_add.png | Bin .../src/main/webapp/icons}/tag_blue_add2.png | Bin .../src/main/webapp/icons}/tag_green.png | Bin .../src/main/webapp/icons}/tag_orange.png | Bin .../src/main/webapp/icons}/tag_pink.png | Bin .../src/main/webapp/icons}/tag_purple.png | Bin .../src/main/webapp/icons}/tag_red.png | Bin .../src/main/webapp/icons}/tag_yellow.png | Bin .../src/main/webapp/icons/task_0.png | Bin .../src/main/webapp/icons/task_100.png | Bin .../src/main/webapp/icons/task_25.png | Bin .../src/main/webapp/icons/task_50.png | Bin .../src/main/webapp/icons/task_75.png | Bin .../main/webapp/icons/thumb_thumb_down.png | Bin .../src/main/webapp/icons/thumb_thumb_up.png | Bin .../src/main/webapp/icons/tick_cross.png | Bin .../src/main/webapp/icons/tick_tick.png | Bin .../src/main/webapp/icons/time_calendar.png | Bin .../src/main/webapp/icons/time_clock.png | Bin .../src/main/webapp/icons/time_hourglass.png | Bin .../main/webapp/icons/weather_clear-night.png | Bin .../src/main/webapp/icons/weather_clear.png | Bin .../webapp/icons/weather_few-clouds-night.png | Bin .../main/webapp/icons/weather_few-clouds.png | Bin .../main/webapp/icons/weather_overcast.png | Bin .../webapp/icons/weather_severe-alert.png | Bin .../icons/weather_showers-scattered.png | Bin .../src/main/webapp/icons/weather_showers.png | Bin .../src/main/webapp/icons/weather_snow.png | Bin .../src/main/webapp/icons/weather_storm.png | Bin .../src/main/webapp/images/alert-sign.png | Bin .../webapp/images/editor}/ajax-loader.gif | Bin .../main/webapp/images/editor/alert-sign.png | Bin 0 -> 5000 bytes .../webapp/images/editor}/btn-bg-hover.png | Bin .../webapp/images/editor}/btn-bg-normal.png | Bin .../webapp/images/editor}/btne-bg-hover.png | Bin .../webapp/images/editor}/btne-bg-normal.png | Bin .../images/editor}/btne-bg-selected.png | Bin .../main/webapp/images/editor}/discard.png | Bin .../webapp/images/editor}/editortoolbar.png | Bin .../src/main/webapp/images/editor}/export.png | Bin .../main/webapp/images/editor}/favicon.ico | Bin .../main/webapp/images/editor}/font-bold.png | Bin .../main/webapp/images/editor}/font-color.png | Bin .../webapp/images/editor}/font-italic.png | Bin .../main/webapp/images/editor}/font-size.png | Bin .../main/webapp/images/editor}/font-type.png | Bin .../main/webapp/images/editor}/history.png | Bin .../src/main/webapp/images/editor}/links.png | Bin .../webapp/images/editor}/logo-135x135.png | Bin .../webapp/images/editor}/logo-head-only.png | Bin .../webapp/images/editor}/logo-medium.png | Bin .../main/webapp/images/editor}/logo-small.png | Bin .../webapp/images/editor}/logo-xsmall.png | Bin .../src/main/webapp/images/editor}/notes.png | Bin .../src/main/webapp/images/editor}/print.png | Bin .../src/main/webapp/images/editor}/public.png | Bin .../src/main/webapp/images/editor}/redo.png | Bin .../src/main/webapp/images/editor}/save.png | Bin .../webapp/images/editor}/shape-circle.png | Bin .../main/webapp/images/editor}/shape-line.png | Bin .../images/editor}/shape-rectangle-round.png | Bin .../webapp/images/editor}/shape-rectangle.png | Bin .../src/main/webapp/images/editor}/share.png | Bin .../src/main/webapp/images/editor}/tag.png | Bin .../main/webapp/images/editor}/topic-add.png | Bin .../webapp/images/editor}/topic-border.png | Bin .../webapp/images/editor}/topic-color.png | Bin .../webapp/images/editor}/topic-delete.png | Bin .../main/webapp/images/editor}/topic-icon.png | Bin .../main/webapp/images/editor}/topic-link.png | Bin .../main/webapp/images/editor}/topic-note.png | Bin .../webapp/images/editor}/topic-relation.png | Bin .../webapp/images/editor}/topic-shape.png | Bin .../src/main/webapp/images/editor}/undo.png | Bin .../main/webapp/images/editor}/zoom-in.png | Bin .../main/webapp/images/editor}/zoom-out.png | Bin .../src/main/webapp/images/favicon.ico | Bin 1150 -> 0 bytes .../webapp/images/html5-badge-h-graphics.png | Bin 3190 -> 0 bytes wise-webapp/src/main/webapp/images/links.png | Bin 0 -> 2631 bytes wise-webapp/src/main/webapp/images/notes.png | Bin 0 -> 2240 bytes .../webapp/images/openid-providers-en.png | Bin 15894 -> 0 bytes .../src/main/webapp/images/shape-circle.png | Bin 0 -> 2416 bytes .../src/main/webapp/images/shape-line.png | Bin 0 -> 1966 bytes .../webapp/images/shape-rectangle-round.png | Bin 0 -> 2303 bytes .../main/webapp/images/shape-rectangle.png | Bin 0 -> 2055 bytes .../src/main/webapp/images/sort_asc.png | Bin 263 -> 0 bytes .../main/webapp/images/sort_asc_disabled.png | Bin 252 -> 0 bytes .../src/main/webapp/images/sort_both.png | Bin 282 -> 0 bytes .../src/main/webapp/images/sort_desc.png | Bin 260 -> 0 bytes .../main/webapp/images/sort_desc_disabled.png | Bin 251 -> 0 bytes .../src/main/webapp/images/star-off-hover.png | Bin 367 -> 0 bytes .../src/main/webapp/images/star-off.png | Bin 294 -> 0 bytes .../src/main/webapp/images/star-on-hover.png | Bin 490 -> 0 bytes .../src/main/webapp/images/star-on.png | Bin 315 -> 0 bytes .../main/webapp/js/jquery.dataTables.min.js | 151 - wise-webapp/src/main/webapp/js/jquery.js | 1 - .../src/main/webapp/js/jquery.timeago.ca.js | 18 - .../src/main/webapp/js/jquery.timeago.de.js | 18 - .../src/main/webapp/js/jquery.timeago.en.js | 20 - .../main/webapp/js/jquery.timeago.en_us.js | 20 - .../src/main/webapp/js/jquery.timeago.es.js | 18 - .../src/main/webapp/js/jquery.timeago.fr.js | 17 - .../src/main/webapp/js/jquery.timeago.js | 148 - .../src/main/webapp/js/jquery.timeago.pt.js | 16 - .../main/webapp/js/jquery.timeago.zh_cn.js | 20 - .../main/webapp/js/jquery.timeago.zh_tw.js | 20 - wise-webapp/src/main/webapp/js/less.js | 12 +- wise-webapp/src/main/webapp/js/mindmapList.js | 688 -- .../src/main/webapp/js/mootools-core.js | 1 - .../src/main/webapp/js/underscorejs.js | 1 - .../src/main/webapp/jsp/accountSettings.jsp | 265 - .../jsp/activationAccountConfirmation.jsp | 20 - .../jsp/activationAccountConfirmationFail.jsp | 15 - .../main/webapp/jsp/browserNotSupported.jsp | 21 - wise-webapp/src/main/webapp/jsp/footer.jsp | 49 - .../src/main/webapp/jsp/googleAnalytics.jsf | 5 - wise-webapp/src/main/webapp/jsp/header.jsp | 91 - wise-webapp/src/main/webapp/jsp/homepage.jsp | 6 - .../src/main/webapp/jsp/labelIconList.jsp | 132 - wise-webapp/src/main/webapp/jsp/login.jsp | 91 - .../src/main/webapp/jsp/mindmapDetail.jsp | 69 - .../src/main/webapp/jsp/mindmapEditor.jsp | 89 +- .../main/webapp/jsp/mindmapEditorToolbar.jsf | 48 +- .../src/main/webapp/jsp/mindmapExport.jsp | 155 - .../src/main/webapp/jsp/mindmapHistory.jsp | 72 - .../src/main/webapp/jsp/mindmapImport.jsp | 129 - .../src/main/webapp/jsp/mindmapList.jsp | 624 -- .../src/main/webapp/jsp/mindmapPublish.jsp | 138 - .../src/main/webapp/jsp/mindmapShare.jsp | 322 - .../src/main/webapp/jsp/reactInclude.jsp | 62 + wise-webapp/src/main/webapp/jsp/template.jsp | 11 +- .../src/main/webapp/jsp/termsOfUse.jsp | 207 - .../main/webapp/jsp/userForgotPassword.jsp | 37 - .../webapp/jsp/userForgotPasswordError.jsp | 6 - .../webapp/jsp/userForgotPasswordSuccess.jsp | 14 - .../src/main/webapp/jsp/userRegistration.jsp | 77 - .../webapp/jsp/userRegistrationSuccess.jsp | 27 - .../webapp/map-icons/icons/arrow_down.gif | Bin 0 -> 62 bytes .../webapp/map-icons/icons}/arrow_down.png | Bin .../webapp/map-icons/icons}/arrow_left.png | Bin .../webapp/map-icons/icons}/arrow_merge.png | Bin .../webapp/map-icons/icons}/arrow_right.png | Bin .../main/webapp/map-icons/icons}/arrow_up.png | Bin .../icons/arrowc_rotate_anticlockwise.png | Bin .../icons/arrowc_rotate_clockwise.png | Bin .../map-icons/icons/arrowc_turn_left.png | Bin .../map-icons/icons/arrowc_turn_right.png | Bin .../src/main/webapp/map-icons/icons/bomb.png | Bin 0 -> 793 bytes .../webapp/map-icons/icons/bulb_light_off.png | Bin .../webapp/map-icons/icons/bulb_light_on.png | Bin .../webapp/map-icons/icons}/bullet_black.png | Bin .../webapp/map-icons/icons}/bullet_blue.png | Bin .../webapp/map-icons/icons}/bullet_green.png | Bin .../webapp/map-icons/icons}/bullet_orange.png | Bin .../webapp/map-icons/icons}/bullet_pink.png | Bin .../webapp/map-icons/icons}/bullet_purple.png | Bin .../webapp/map-icons/icons}/bullet_red.png | Bin .../webapp/map-icons/icons}/chart_bar.png | Bin .../webapp/map-icons/icons}/chart_curve.png | Bin .../webapp/map-icons/icons}/chart_line.png | Bin .../map-icons/icons}/chart_organisation.png | Bin .../webapp/map-icons/icons}/chart_pie.png | Bin .../main/webapp/map-icons/icons}/close.png | Bin .../webapp/map-icons/icons/conn_connect.png | Bin .../map-icons/icons/conn_disconnect.png | Bin .../webapp/map-icons/icons/face_crying.png | Bin .../webapp/map-icons/icons/face_plain.png | Bin .../main/webapp/map-icons/icons/face_sad.png | Bin .../webapp/map-icons/icons/face_smile-big.png | Bin .../webapp/map-icons/icons/face_smile.png | Bin .../webapp/map-icons/icons/face_surprise.png | Bin .../main/webapp/map-icons/icons/face_wink.png | Bin .../webapp/map-icons/icons}/flag_blue.png | Bin .../webapp/map-icons/icons}/flag_green.png | Bin .../webapp/map-icons/icons}/flag_orange.png | Bin .../webapp/map-icons/icons}/flag_pink.png | Bin .../webapp/map-icons/icons}/flag_purple.png | Bin .../webapp/map-icons/icons}/flag_yellow.png | Bin .../webapp/map-icons/icons/funy_angel.png | Bin .../webapp/map-icons/icons/funy_devilish.png | Bin .../webapp/map-icons/icons/funy_glasses.png | Bin .../main/webapp/map-icons/icons/funy_grin.png | Bin .../main/webapp/map-icons/icons/funy_kiss.png | Bin .../webapp/map-icons/icons/funy_monkey.png | Bin .../webapp/map-icons/icons/gener_female.png | Bin 0 -> 590 bytes .../webapp/map-icons/icons/gener_male.png | Bin 0 -> 629 bytes .../main/webapp/map-icons/icons/hard_cd.png | Bin 0 -> 673 bytes .../webapp/map-icons/icons/hard_computer.png | Bin 0 -> 667 bytes .../map-icons/icons/hard_controller.png | Bin 0 -> 666 bytes .../webapp/map-icons/icons/hard_drive_cd.png | Bin 0 -> 734 bytes .../map-icons/icons/hard_driver_disk.png | Bin 0 -> 620 bytes .../main/webapp/map-icons/icons/hard_ipod.png | Bin 0 -> 463 bytes .../webapp/map-icons/icons/hard_keyboard.png | Bin 0 -> 570 bytes .../webapp/map-icons/icons/hard_mouse.png | Bin 0 -> 634 bytes .../webapp/map-icons/icons/hard_printer.png | Bin 0 -> 731 bytes .../webapp/map-icons}/icons/legacy/add.png | Bin .../map-icons/icons/legacy/arrow_down.png | Bin 0 -> 379 bytes .../map-icons/icons/legacy/arrow_left.png | Bin 0 -> 345 bytes .../map-icons/icons/legacy/arrow_merge.png | Bin 0 -> 484 bytes .../map-icons/icons/legacy/arrow_right.png | Bin 0 -> 409 bytes .../legacy/arrow_rotate_anticlockwise.png | Bin 0 -> 608 bytes .../icons/legacy/arrow_rotate_clockwise.png | Bin 0 -> 602 bytes .../icons/legacy/arrow_turn_left.png | Bin 0 -> 516 bytes .../icons/legacy/arrow_turn_right.png | Bin 0 -> 489 bytes .../map-icons/icons/legacy/arrow_up.png | Bin 0 -> 372 bytes .../map-icons}/icons/legacy/backColor.png | Bin .../map-icons}/icons/legacy/balloon.png | Bin .../webapp/map-icons}/icons/legacy/bin.png | Bin .../icons/legacy/black-keyboard.png | Bin .../webapp/map-icons}/icons/legacy/bold.png | Bin .../map-icons}/icons/legacy/borderColor.png | Bin .../map-icons/icons/legacy/bullet_black.png | Bin 0 -> 211 bytes .../map-icons/icons/legacy/bullet_blue.png | Bin 0 -> 289 bytes .../map-icons/icons/legacy/bullet_green.png | Bin 0 -> 295 bytes .../map-icons/icons/legacy/bullet_orange.png | Bin 0 -> 283 bytes .../map-icons/icons/legacy/bullet_pink.png | Bin 0 -> 286 bytes .../map-icons/icons/legacy/bullet_purple.png | Bin 0 -> 294 bytes .../map-icons/icons/legacy/bullet_red.png | Bin 0 -> 287 bytes .../map-icons/icons/legacy/chart_bar.png | Bin 0 -> 541 bytes .../map-icons/icons/legacy/chart_curve.png | Bin 0 -> 710 bytes .../map-icons/icons/legacy/chart_line.png | Bin 0 -> 526 bytes .../icons/legacy/chart_organisation.png | Bin 0 -> 444 bytes .../map-icons/icons/legacy/chart_pie.png | Bin 0 -> 918 bytes .../webapp/map-icons}/icons/legacy/clock.png | Bin .../map-icons}/icons/legacy/clock_red.png | Bin .../webapp/map-icons/icons/legacy/close.png | Bin 0 -> 3758 bytes .../webapp/map-icons}/icons/legacy/coins.png | Bin .../icons/legacy/collab_publish.png | Bin .../map-icons}/icons/legacy/collab_share.png | Bin .../map-icons}/icons/legacy/collab_tag.png | Bin .../map-icons}/icons/legacy/color_swatch.png | Bin .../map-icons}/icons/legacy/comment.png | Bin .../webapp/map-icons/icons/legacy/connect.png | Bin 0 -> 748 bytes .../webapp/map-icons}/icons/legacy/cross.png | Bin .../map-icons}/icons/legacy/delNode.png | Bin .../webapp/map-icons}/icons/legacy/delete.png | Bin .../map-icons/icons/legacy/disconnect.png | Bin 0 -> 796 bytes .../map-icons/icons/legacy/face-angel.png | Bin 0 -> 992 bytes .../map-icons/icons/legacy/face-crying.png | Bin 0 -> 936 bytes .../map-icons/icons/legacy/face-devilish.png | Bin 0 -> 855 bytes .../map-icons/icons/legacy/face-glasses.png | Bin 0 -> 949 bytes .../map-icons/icons/legacy/face-grin.png | Bin 0 -> 905 bytes .../map-icons/icons/legacy/face-kiss.png | Bin 0 -> 919 bytes .../map-icons/icons/legacy/face-monkey.png | Bin 0 -> 784 bytes .../map-icons/icons/legacy/face-plain.png | Bin 0 -> 894 bytes .../map-icons/icons/legacy/face-sad.png | Bin 0 -> 918 bytes .../map-icons/icons/legacy/face-smile-big.png | Bin 0 -> 896 bytes .../map-icons/icons/legacy/face-smile.png | Bin 0 -> 919 bytes .../map-icons/icons/legacy/face-surprise.png | Bin 0 -> 917 bytes .../map-icons/icons/legacy/face-wink.png | Bin 0 -> 914 bytes .../map-icons}/icons/legacy/file_export.png | Bin .../map-icons}/icons/legacy/file_printer.png | Bin .../map-icons}/icons/legacy/file_redo.png | Bin .../map-icons}/icons/legacy/file_redo_dis.png | Bin .../map-icons}/icons/legacy/file_undo.png | Bin .../map-icons}/icons/legacy/file_undo_dis.png | Bin .../map-icons/icons/legacy/flag_blue.png | Bin 0 -> 671 bytes .../map-icons/icons/legacy/flag_green.png | Bin 0 -> 672 bytes .../map-icons/icons/legacy/flag_orange.png | Bin 0 -> 669 bytes .../map-icons/icons/legacy/flag_pink.png | Bin 0 -> 651 bytes .../map-icons/icons/legacy/flag_purple.png | Bin 0 -> 656 bytes .../map-icons/icons/legacy/flag_yellow.png | Bin 0 -> 671 bytes .../webapp/map-icons}/icons/legacy/font.png | Bin .../map-icons}/icons/legacy/fontColor.png | Bin .../map-icons}/icons/legacy/fontSize.png | Bin .../map-icons}/icons/legacy/font_bold.png | Bin .../map-icons}/icons/legacy/font_color.png | Bin .../map-icons}/icons/legacy/font_italic.png | Bin .../map-icons}/icons/legacy/font_size.png | Bin .../map-icons}/icons/legacy/font_type.png | Bin .../webapp/map-icons}/icons/legacy/group.png | Bin .../webapp/map-icons}/icons/legacy/group2.png | Bin .../map-icons}/icons/legacy/group_go.png | Bin .../webapp/map-icons}/icons/legacy/help.png | Bin .../map-icons}/icons/legacy/history.png | Bin .../webapp/map-icons}/icons/legacy/info.png | Bin .../webapp/map-icons}/icons/legacy/italic.png | Bin .../webapp/map-icons}/icons/legacy/key.png | Bin .../map-icons/icons/legacy/lightbulb.png | Bin 0 -> 782 bytes .../map-icons/icons/legacy/lightbulb_off.png | Bin 0 -> 700 bytes .../webapp/map-icons}/icons/legacy/links.png | Bin .../webapp/map-icons}/icons/legacy/lock.png | Bin .../map-icons/icons/legacy}/lock_open.png | Bin .../map-icons}/icons/legacy/logo-big.png | Bin .../map-icons}/icons/legacy/logo-vsmall.png | Bin .../map-icons}/icons/legacy/logo-vvsmall.png | Bin .../map-icons}/icons/legacy/marca-vsmall.png | Bin .../webapp/map-icons}/icons/legacy/money.png | Bin .../map-icons/icons/legacy}/money_dollar.png | Bin .../map-icons/icons/legacy}/money_euro.png | Bin .../map-icons/icons/legacy}/money_pound.png | Bin .../map-icons/icons/legacy}/money_yen.png | Bin .../map-icons}/icons/legacy/moor_boverlay.png | Bin .../map-icons}/icons/legacy/moor_slider.png | Bin .../map-icons}/icons/legacy/moor_woverlay.png | Bin .../webapp/map-icons}/icons/legacy/move.png | Bin .../webapp/map-icons}/icons/legacy/mymaps.png | Bin .../map-icons}/icons/legacy/node_add.png | Bin .../map-icons}/icons/legacy/node_border.png | Bin .../map-icons}/icons/legacy/node_border2.png | Bin .../map-icons}/icons/legacy/node_elipse.png | Bin .../webapp/map-icons}/icons/legacy/note.png | Bin .../webapp/map-icons}/icons/legacy/note1.png | Bin .../map-icons}/icons/legacy/page_delete.png | Bin .../map-icons}/icons/legacy/page_go.png | Bin .../map-icons}/icons/legacy/printer.png | Bin .../map-icons}/icons/legacy/removeUser.jpeg | Bin .../webapp/map-icons}/icons/legacy/ruby.png | Bin .../webapp/map-icons}/icons/legacy/save.png | Bin .../webapp/map-icons}/icons/legacy/search.png | Bin .../map-icons}/icons/legacy/search2.png | Bin .../map-icons}/icons/legacy/search3.png | Bin .../webapp/map-icons}/icons/legacy/seast.png | Bin .../map-icons}/icons/legacy/shape-elipse.png | Bin .../map-icons}/icons/legacy/shape-line.png | Bin .../icons/legacy/shape-rectangle-rounded.png | Bin .../icons/legacy/shape-rectangle.png | Bin .../webapp/map-icons}/icons/legacy/shape.png | Bin .../map-icons}/icons/legacy/shape_handles.png | Bin .../icons/legacy/shape_square_add.png | Bin .../icons/legacy/shape_square_delete.png | Bin .../icons/legacy/shape_square_edit.png | Bin .../map-icons}/icons/legacy/signUpBodyBtn.png | Bin .../map-icons}/icons/legacy/signUpEndBtn.png | Bin .../icons/legacy/signUpStartBtn.png | Bin .../webapp/map-icons}/icons/legacy/sne.png | Bin .../webapp/map-icons}/icons/legacy/snorth.png | Bin .../webapp/map-icons}/icons/legacy/snw.png | Bin .../webapp/map-icons}/icons/legacy/sse.png | Bin .../webapp/map-icons}/icons/legacy/ssouth.png | Bin .../webapp/map-icons}/icons/legacy/ssw.png | Bin .../webapp/map-icons}/icons/legacy/swest.png | Bin .../map-icons/icons/legacy}/tag_blue.png | Bin .../map-icons/icons/legacy}/tag_blue_add.png | Bin .../map-icons/icons/legacy}/tag_blue_add2.png | Bin .../map-icons/icons/legacy}/tag_green.png | Bin .../map-icons/icons/legacy}/tag_orange.png | Bin .../map-icons/icons/legacy}/tag_pink.png | Bin .../map-icons/icons/legacy}/tag_purple.png | Bin .../map-icons/icons/legacy}/tag_red.png | Bin .../map-icons/icons/legacy}/tag_yellow.png | Bin .../map-icons}/icons/legacy/text_bold.png | Bin .../map-icons}/icons/legacy/text_italic.png | Bin .../map-icons}/icons/legacy/thumb_down.png | Bin .../map-icons}/icons/legacy/thumb_up.png | Bin .../webapp/map-icons}/icons/legacy/tick.png | Bin .../map-icons}/icons/legacy/user_delete.png | Bin .../map-icons}/icons/legacy/waring_icon.png | Bin .../webapp/map-icons}/icons/legacy/world.png | Bin .../webapp/map-icons}/icons/legacy/world2.png | Bin .../map-icons}/icons/legacy/world_go.png | Bin .../map-icons}/icons/legacy/world_link.png | Bin .../map-icons}/icons/legacy/zoom_in.png | Bin .../map-icons}/icons/legacy/zoom_out.png | Bin .../webapp/map-icons/icons/lock_close.png | Bin 0 -> 749 bytes .../main/webapp/map-icons/icons/lock_open.png | Bin 0 -> 727 bytes .../main/webapp/map-icons/icons/mail_edit.png | Bin 0 -> 880 bytes .../webapp/map-icons/icons/mail_envelop.png | Bin 0 -> 641 bytes .../main/webapp/map-icons/icons/mail_list.png | Bin 0 -> 566 bytes .../webapp/map-icons/icons/mail_mailbox.png | Bin 0 -> 555 bytes .../webapp/map-icons/icons/money_coins.png | Bin 0 -> 732 bytes .../webapp/map-icons/icons/money_dollar.png | Bin 0 -> 630 bytes .../webapp/map-icons/icons/money_euro.png | Bin 0 -> 605 bytes .../webapp/map-icons/icons/money_money.png | Bin 0 -> 738 bytes .../webapp/map-icons/icons/money_pound.png | Bin 0 -> 565 bytes .../webapp/map-icons/icons/money_ruby.png | Bin 0 -> 592 bytes .../main/webapp/map-icons/icons/money_yen.png | Bin 0 -> 562 bytes .../main/webapp/map-icons/icons/number_1.png | Bin 0 -> 3442 bytes .../main/webapp/map-icons/icons/number_2.png | Bin 0 -> 3573 bytes .../main/webapp/map-icons/icons/number_3.png | Bin 0 -> 3667 bytes .../main/webapp/map-icons/icons/number_4.png | Bin 0 -> 3629 bytes .../main/webapp/map-icons/icons/number_5.png | Bin 0 -> 3642 bytes .../main/webapp/map-icons/icons/number_6.png | Bin 0 -> 3688 bytes .../main/webapp/map-icons/icons/number_7.png | Bin 0 -> 3530 bytes .../main/webapp/map-icons/icons/number_8.png | Bin 0 -> 3681 bytes .../main/webapp/map-icons/icons/number_9.png | Bin 0 -> 3697 bytes .../webapp/map-icons/icons/object_bell.png | Bin 0 -> 789 bytes .../webapp/map-icons/icons/object_cake.png | Bin 0 -> 676 bytes .../webapp/map-icons/icons/object_camera.png | Bin 0 -> 665 bytes .../map-icons/icons/object_clanbomber.png | Bin 0 -> 793 bytes .../webapp/map-icons/icons/object_clip.png | Bin 0 -> 391 bytes .../webapp/map-icons/icons/object_house.png | Bin 0 -> 806 bytes .../webapp/map-icons/icons/object_key.png | Bin 0 -> 612 bytes .../map-icons/icons/object_magnifier.png | Bin 0 -> 615 bytes .../webapp/map-icons/icons/object_music.png | Bin 0 -> 385 bytes .../webapp/map-icons/icons/object_palette.png | Bin 0 -> 856 bytes .../webapp/map-icons/icons/object_pencil.png | Bin 0 -> 450 bytes .../webapp/map-icons/icons/object_phone.png | Bin 0 -> 488 bytes .../webapp/map-icons/icons/object_rainbow.png | Bin 0 -> 655 bytes .../webapp/map-icons/icons/object_star.png | Bin 0 -> 670 bytes .../webapp/map-icons/icons/object_wizard.png | Bin 0 -> 570 bytes .../main/webapp/map-icons/icons/onoff_add.png | Bin 0 -> 733 bytes .../webapp/map-icons/icons/onoff_clock.png | Bin 0 -> 882 bytes .../map-icons/icons/onoff_clock_red.png | Bin 0 -> 889 bytes .../webapp/map-icons/icons/onoff_delete.png | Bin 0 -> 715 bytes .../map-icons/icons/onoff_status_offline.png | Bin 0 -> 422 bytes .../map-icons/icons/onoff_status_online.png | Bin 0 -> 722 bytes .../webapp/map-icons/icons/people_female1.png | Bin 0 -> 663 bytes .../webapp/map-icons/icons/people_female2.png | Bin 0 -> 722 bytes .../webapp/map-icons/icons/people_group.png | Bin 0 -> 753 bytes .../webapp/map-icons/icons/people_male1.png | Bin 0 -> 748 bytes .../webapp/map-icons/icons/people_male2.png | Bin 0 -> 741 bytes .../webapp/map-icons/icons/sign_cancel.png | Bin 0 -> 587 bytes .../webapp/map-icons/icons/sign_closed.png | Bin 0 -> 715 bytes .../map-icons/icons/sign_exclamation.png | Bin 0 -> 701 bytes .../main/webapp/map-icons/icons/sign_help.png | Bin 0 -> 786 bytes .../main/webapp/map-icons/icons/sign_info.png | Bin 0 -> 778 bytes .../main/webapp/map-icons/icons/sign_stop.png | Bin 0 -> 700 bytes .../webapp/map-icons/icons/sign_warning.png | Bin 0 -> 666 bytes .../main/webapp/map-icons/icons/soft_bug.png | Bin 0 -> 774 bytes .../webapp/map-icons/icons/soft_cursor.png | Bin 0 -> 354 bytes .../webapp/map-icons/icons/soft_database.png | Bin 0 -> 390 bytes .../map-icons/icons/soft_database_table.png | Bin 0 -> 726 bytes .../main/webapp/map-icons/icons/soft_feed.png | Bin 0 -> 691 bytes .../map-icons/icons/soft_folder_explore.png | Bin 0 -> 679 bytes .../webapp/map-icons/icons/soft_penguin.png | Bin 0 -> 696 bytes .../main/webapp/map-icons/icons/soft_rss.png | Bin 0 -> 530 bytes .../map-icons/icons/soft_stuff_folder.png | Bin 0 -> 537 bytes .../map-icons/icons/sport_basketball.png | Bin 0 -> 977 bytes .../webapp/map-icons/icons/sport_football.png | Bin 0 -> 875 bytes .../webapp/map-icons/icons/sport_golf.png | Bin 0 -> 504 bytes .../webapp/map-icons/icons/sport_raquet.png | Bin 0 -> 719 bytes .../map-icons/icons/sport_shuttlecock.png | Bin 0 -> 683 bytes .../webapp/map-icons/icons/sport_soccer.png | Bin 0 -> 517 bytes .../webapp/map-icons/icons/sport_tennis.png | Bin 0 -> 884 bytes .../main/webapp/map-icons/icons/tag_blue.png | Bin 0 -> 586 bytes .../webapp/map-icons/icons/tag_blue_add.png | Bin 0 -> 824 bytes .../webapp/map-icons/icons/tag_blue_add2.png | Bin 0 -> 836 bytes .../main/webapp/map-icons/icons/tag_green.png | Bin 0 -> 613 bytes .../webapp/map-icons/icons/tag_orange.png | Bin 0 -> 586 bytes .../main/webapp/map-icons/icons/tag_pink.png | Bin 0 -> 579 bytes .../webapp/map-icons/icons/tag_purple.png | Bin 0 -> 599 bytes .../main/webapp/map-icons/icons/tag_red.png | Bin 0 -> 592 bytes .../webapp/map-icons/icons/tag_yellow.png | Bin 0 -> 586 bytes .../main/webapp/map-icons/icons/task_0.png | Bin 3271 -> 3225 bytes .../main/webapp/map-icons/icons/task_100.png | Bin 2972 -> 3221 bytes .../main/webapp/map-icons/icons/task_25.png | Bin 0 -> 3300 bytes .../main/webapp/map-icons/icons/task_50.png | Bin 0 -> 3297 bytes .../main/webapp/map-icons/icons/task_75.png | Bin 0 -> 3285 bytes .../map-icons/icons/thumb_thumb_down.png | Bin 0 -> 601 bytes .../webapp/map-icons/icons/thumb_thumb_up.png | Bin 0 -> 619 bytes .../webapp/map-icons/icons/tick_cross.png | Bin 0 -> 655 bytes .../main/webapp/map-icons/icons/tick_tick.png | Bin 0 -> 537 bytes .../webapp/map-icons/icons/time_calendar.png | Bin 0 -> 572 bytes .../webapp/map-icons/icons/time_clock.png | Bin 0 -> 793 bytes .../webapp/map-icons/icons/time_hourglass.png | Bin 0 -> 744 bytes .../map-icons/icons/weather_clear-night.png | Bin 0 -> 961 bytes .../webapp/map-icons/icons/weather_clear.png | Bin 0 -> 682 bytes .../icons/weather_few-clouds-night.png | Bin 0 -> 965 bytes .../map-icons/icons/weather_few-clouds.png | Bin 0 -> 763 bytes .../map-icons/icons/weather_overcast.png | Bin 0 -> 975 bytes .../map-icons/icons/weather_severe-alert.png | Bin 0 -> 977 bytes .../icons/weather_showers-scattered.png | Bin 0 -> 1045 bytes .../map-icons/icons/weather_showers.png | Bin 0 -> 959 bytes .../webapp/map-icons/icons/weather_snow.png | Bin 0 -> 998 bytes .../webapp/map-icons/icons/weather_storm.png | Bin 0 -> 1031 bytes .../webapp/map-icons/images/alert-sign.png | Bin 0 -> 5000 bytes .../main/webapp/map-icons/images/links.png | Bin 0 -> 2631 bytes .../main/webapp/map-icons/images/notes.png | Bin 0 -> 2240 bytes .../webapp/map-icons/images/shape-circle.png | Bin 0 -> 2416 bytes .../webapp/map-icons/images/shape-line.png | Bin 0 -> 1966 bytes .../images/shape-rectangle-round.png | Bin 0 -> 2303 bytes .../map-icons/images/shape-rectangle.png | Bin 0 -> 2055 bytes wise-webapp/src/main/webapp/static/mindplot | 1 + wise-webapp/src/main/webapp/static/webapp | 1 + .../test/export/ExportFreemindTest.java | 3 +- .../test/export/ExportSVGBasedTest.java | 23 +- .../test/export/ExportXsltBasedTest.java | 3 +- .../importer/FreeMindImportExportTest.java | 5 +- .../com/wisemapping/test/model/IconsTest.java | 2 +- .../com/wisemapping/test/model/JsonTest.java | 5 +- .../test/rest/RestAccountITCase.java | 12 +- .../test/rest/RestAdminITCase.java | 11 +- .../test/rest/RestLabelITCase.java | 6 +- .../test/rest/RestMindmapITCase.java | 172 +- yarn.lock | 4 + 1042 files changed, 1160 insertions(+), 73432 deletions(-) delete mode 100644 core-js/pom.xml delete mode 100644 core-js/src/main/javascript/Functions.js delete mode 100644 core-js/src/main/javascript/Utils.js delete mode 100644 core-js/src/main/javascript/header.js delete mode 100644 core-js/src/test/javascript/testSuite.js delete mode 100644 mindplot/pom.xml delete mode 100644 mindplot/src/main/javascript/.gitignore delete mode 100644 mindplot/src/main/javascript/ActionDispatcher.js delete mode 100644 mindplot/src/main/javascript/ActionIcon.js delete mode 100644 mindplot/src/main/javascript/CentralTopic.js delete mode 100644 mindplot/src/main/javascript/Command.js delete mode 100644 mindplot/src/main/javascript/ConnectionLine.js delete mode 100644 mindplot/src/main/javascript/ControlPoint.js delete mode 100644 mindplot/src/main/javascript/Designer.js delete mode 100644 mindplot/src/main/javascript/DesignerActionRunner.js delete mode 100644 mindplot/src/main/javascript/DesignerKeyboard.js delete mode 100644 mindplot/src/main/javascript/DesignerModel.js delete mode 100644 mindplot/src/main/javascript/DesignerUndoManager.js delete mode 100644 mindplot/src/main/javascript/DragConnector.js delete mode 100644 mindplot/src/main/javascript/DragManager.js delete mode 100644 mindplot/src/main/javascript/DragPivot.js delete mode 100644 mindplot/src/main/javascript/DragTopic.js delete mode 100644 mindplot/src/main/javascript/EditorOptions.js delete mode 100644 mindplot/src/main/javascript/EditorProperties.js delete mode 100644 mindplot/src/main/javascript/Events.js delete mode 100644 mindplot/src/main/javascript/Icon.js delete mode 100644 mindplot/src/main/javascript/IconGroup.js delete mode 100644 mindplot/src/main/javascript/ImageIcon.js delete mode 100644 mindplot/src/main/javascript/Keyboard.js delete mode 100644 mindplot/src/main/javascript/LinkIcon.js delete mode 100644 mindplot/src/main/javascript/LocalStorageManager.js delete mode 100644 mindplot/src/main/javascript/MainTopic.js delete mode 100644 mindplot/src/main/javascript/Messages.js delete mode 100644 mindplot/src/main/javascript/MultilineTextEditor.js delete mode 100644 mindplot/src/main/javascript/NodeGraph.js delete mode 100644 mindplot/src/main/javascript/NoteIcon.js delete mode 100644 mindplot/src/main/javascript/Options.js delete mode 100644 mindplot/src/main/javascript/PersistenceManager.js delete mode 100644 mindplot/src/main/javascript/Relationship.js delete mode 100644 mindplot/src/main/javascript/RelationshipPivot.js delete mode 100644 mindplot/src/main/javascript/RestPersistenceManager.js delete mode 100644 mindplot/src/main/javascript/ScreenManager.js delete mode 100644 mindplot/src/main/javascript/ShrinkConnector.js delete mode 100644 mindplot/src/main/javascript/StandaloneActionDispatcher.js delete mode 100644 mindplot/src/main/javascript/TextEditor.js delete mode 100644 mindplot/src/main/javascript/TextEditorFactory.js delete mode 100644 mindplot/src/main/javascript/Topic.js delete mode 100644 mindplot/src/main/javascript/TopicEventDispatcher.js delete mode 100644 mindplot/src/main/javascript/TopicFeature.js delete mode 100644 mindplot/src/main/javascript/TopicStyle.js delete mode 100644 mindplot/src/main/javascript/Workspace.js delete mode 100644 mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js delete mode 100644 mindplot/src/main/javascript/commands/AddRelationshipCommand.js delete mode 100644 mindplot/src/main/javascript/commands/AddTopicCommand.js delete mode 100644 mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js delete mode 100644 mindplot/src/main/javascript/commands/DeleteCommand.js delete mode 100644 mindplot/src/main/javascript/commands/DragTopicCommand.js delete mode 100644 mindplot/src/main/javascript/commands/GenericFunctionCommand.js delete mode 100644 mindplot/src/main/javascript/commands/MoveControlPointCommand.js delete mode 100644 mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js delete mode 100644 mindplot/src/main/javascript/footer.js delete mode 100644 mindplot/src/main/javascript/header.js delete mode 100644 mindplot/src/main/javascript/layout/AbstractBasicSorter.js delete mode 100644 mindplot/src/main/javascript/layout/BalancedSorter.js delete mode 100644 mindplot/src/main/javascript/layout/ChangeEvent.js delete mode 100644 mindplot/src/main/javascript/layout/ChildrenSorterStrategy.js delete mode 100644 mindplot/src/main/javascript/layout/EventBus.js delete mode 100644 mindplot/src/main/javascript/layout/EventBusDispatcher.js delete mode 100644 mindplot/src/main/javascript/layout/GridSorter.js delete mode 100644 mindplot/src/main/javascript/layout/LayoutManager.js delete mode 100644 mindplot/src/main/javascript/layout/Node.js delete mode 100644 mindplot/src/main/javascript/layout/OriginalLayout.js delete mode 100644 mindplot/src/main/javascript/layout/RootedTreeSet.js delete mode 100644 mindplot/src/main/javascript/layout/SymmetricSorter.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap-colorpicker.css delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap-colorpicker.min.css delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap-theme.css delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap-theme.css.map delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap-theme.min.css delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap.css delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/css/bootstrap.css.map delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/fonts/glyphicons-halflings-regular.eot delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/fonts/glyphicons-halflings-regular.svg delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/fonts/glyphicons-halflings-regular.ttf delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/fonts/glyphicons-halflings-regular.woff delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/img/bootstrap-colorpicker/alpha-horizontal.png delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/img/bootstrap-colorpicker/hue-horizontal.png delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/img/bootstrap-colorpicker/saturation.png delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/img/glyphicons-halflings-blue.png delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/js/bootstrap-colorpicker.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/js/bootstrap-colorpicker.min.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/js/bootstrap.js delete mode 100644 mindplot/src/main/javascript/libraries/bootstrap/js/bootstrap.min.js delete mode 100644 mindplot/src/main/javascript/libraries/hotkeys/jquery.hotkeys.js delete mode 100644 mindplot/src/main/javascript/libraries/jquery/jquery-2.1.0.js delete mode 100644 mindplot/src/main/javascript/libraries/jquery/jquery-2.1.0.min.js delete mode 100644 mindplot/src/main/javascript/libraries/jquery/jquery.mousewheel.min.js delete mode 100755 mindplot/src/main/javascript/libraries/less/less-1.4.2.min.js delete mode 100644 mindplot/src/main/javascript/libraries/less/less-1.6.2.min.js delete mode 100644 mindplot/src/main/javascript/libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js delete mode 100644 mindplot/src/main/javascript/libraries/underscorejs/underscore-min.js delete mode 100644 mindplot/src/main/javascript/model/FeatureModel.js delete mode 100644 mindplot/src/main/javascript/model/IMindmap.js delete mode 100644 mindplot/src/main/javascript/model/INodeModel.js delete mode 100644 mindplot/src/main/javascript/model/IconModel.js delete mode 100644 mindplot/src/main/javascript/model/LinkModel.js delete mode 100644 mindplot/src/main/javascript/model/Mindmap.js delete mode 100644 mindplot/src/main/javascript/model/NodeModel.js delete mode 100644 mindplot/src/main/javascript/model/NoteModel.js delete mode 100644 mindplot/src/main/javascript/model/RelationshipModel.js delete mode 100644 mindplot/src/main/javascript/persistence/Beta2PelaMigrator.js delete mode 100644 mindplot/src/main/javascript/persistence/ModelCodeName.js delete mode 100644 mindplot/src/main/javascript/persistence/Pela2TangoMigrator.js delete mode 100644 mindplot/src/main/javascript/persistence/XMLSerializerFactory.js delete mode 100644 mindplot/src/main/javascript/persistence/XMLSerializer_Beta.js delete mode 100644 mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js delete mode 100644 mindplot/src/main/javascript/persistence/XMLSerializer_Tango.js delete mode 100644 mindplot/src/main/javascript/util/FadeEffect.js delete mode 100644 mindplot/src/main/javascript/util/Shape.js delete mode 100644 mindplot/src/main/javascript/widget/ColorPalettePanel.js delete mode 100644 mindplot/src/main/javascript/widget/FloatingTip.js delete mode 100644 mindplot/src/main/javascript/widget/FontFamilyPanel.js delete mode 100644 mindplot/src/main/javascript/widget/FontSizePanel.js delete mode 100644 mindplot/src/main/javascript/widget/IMenu.js delete mode 100644 mindplot/src/main/javascript/widget/IconPanel.js delete mode 100644 mindplot/src/main/javascript/widget/KeyboardShortcutTooltip.js delete mode 100644 mindplot/src/main/javascript/widget/LinkEditor.js delete mode 100644 mindplot/src/main/javascript/widget/LinkIconTooltip.js delete mode 100644 mindplot/src/main/javascript/widget/ListToolbarPanel.js delete mode 100644 mindplot/src/main/javascript/widget/Menu.js delete mode 100644 mindplot/src/main/javascript/widget/ModalDialogNotifier.js delete mode 100644 mindplot/src/main/javascript/widget/NoteEditor.js delete mode 100644 mindplot/src/main/javascript/widget/ToolbarItem.js delete mode 100644 mindplot/src/main/javascript/widget/ToolbarNotifier.js delete mode 100644 mindplot/src/main/javascript/widget/ToolbarPaneItem.js delete mode 100644 mindplot/src/main/javascript/widget/TopicShapePanel.js delete mode 100644 mindplot/src/main/resources/messages_ca.properties delete mode 100644 mindplot/src/main/resources/messages_de.properties delete mode 100644 mindplot/src/main/resources/messages_en.properties delete mode 100644 mindplot/src/main/resources/messages_es.properties delete mode 100644 mindplot/src/main/resources/messages_fr.properties delete mode 100644 mindplot/src/main/resources/messages_pt_BR.properties delete mode 100644 mindplot/src/main/resources/messages_zh_CN.properties delete mode 100644 mindplot/src/main/resources/messages_zh_TW.properties delete mode 100644 mindplot/src/test/javascript/BalancedTestSuite.js delete mode 100644 mindplot/src/test/javascript/DesignerTestSuite.js delete mode 100644 mindplot/src/test/javascript/EventsTestSuite.js delete mode 100644 mindplot/src/test/javascript/FreeTestSuite.js delete mode 100644 mindplot/src/test/javascript/SymmetricTestSuite.js delete mode 100644 mindplot/src/test/javascript/TestSuite.js delete mode 120000 mindplot/src/test/javascript/lib/bootstrap.js delete mode 120000 mindplot/src/test/javascript/lib/core.js delete mode 100644 mindplot/src/test/javascript/lib/jquery-1.8.2.js delete mode 120000 mindplot/src/test/javascript/lib/jquery.js delete mode 120000 mindplot/src/test/javascript/lib/web2d.svg-min.js delete mode 100644 mindplot/src/test/javascript/simpleTest.js delete mode 100644 mindplot/src/test/javascript/static/layout.html delete mode 100644 mindplot/src/test/javascript/static/palette.html delete mode 100644 mindplot/src/test/javascript/static/sample.xml delete mode 100644 mindplot/src/test/javascript/static/test/BalancedTestSuite.js delete mode 100644 mindplot/src/test/javascript/static/test/FreeTestSuite.js delete mode 100644 mindplot/src/test/javascript/static/test/SymmetricTestSuite.js delete mode 100644 mindplot/src/test/javascript/static/test/TestSuite.js delete mode 100644 mindplot/src/test/javascript/static/test/raphael-min.js delete mode 100644 mindplot/src/test/javascript/static/test/raphael-plugins.js delete mode 100644 mindplot/src/test/resources/welcome.xml delete mode 100644 web2d/pom.xml delete mode 100644 web2d/src/main/javascript/Arrow.js delete mode 100644 web2d/src/main/javascript/CurvedLine.js delete mode 100644 web2d/src/main/javascript/Element.js delete mode 100644 web2d/src/main/javascript/Elipse.js delete mode 100644 web2d/src/main/javascript/Font.js delete mode 100644 web2d/src/main/javascript/Group.js delete mode 100644 web2d/src/main/javascript/Image.js delete mode 100644 web2d/src/main/javascript/Issues.txt delete mode 100644 web2d/src/main/javascript/Line.js delete mode 100644 web2d/src/main/javascript/Point.js delete mode 100644 web2d/src/main/javascript/PolyLine.js delete mode 100644 web2d/src/main/javascript/Rect.js delete mode 100644 web2d/src/main/javascript/Text.js delete mode 100644 web2d/src/main/javascript/Toolkit.js delete mode 100644 web2d/src/main/javascript/Workspace.js delete mode 100644 web2d/src/main/javascript/header.js delete mode 100644 web2d/src/main/javascript/peer/svg/ArialFont.js delete mode 100644 web2d/src/main/javascript/peer/svg/ArrowPeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/CurvedLinePeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/ElementPeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/ElipsePeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/Font.js delete mode 100644 web2d/src/main/javascript/peer/svg/GroupPeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/ImagePeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/LinePeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/PolyLinePeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/RectPeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/TahomaFont.js delete mode 100644 web2d/src/main/javascript/peer/svg/TextPeer.js delete mode 100644 web2d/src/main/javascript/peer/svg/TimesFont.js delete mode 100644 web2d/src/main/javascript/peer/svg/VerdanaFont.js delete mode 100644 web2d/src/main/javascript/peer/svg/WorkspacePeer.js delete mode 100644 web2d/src/main/javascript/peer/utils/EventUtils.js delete mode 100644 web2d/src/main/javascript/peer/utils/TransformUtils.js delete mode 100644 web2d/src/test/javascript/jquery-2.1.0.js delete mode 100755 web2d/src/test/javascript/jsUnit/ElementsTestSuite.html delete mode 100755 web2d/src/test/javascript/jsUnit/WorkspaceTestSuite.html delete mode 100644 web2d/src/test/javascript/mootools-core-1.4.5.js delete mode 100644 web2d/src/test/javascript/render/arrow.html delete mode 100644 web2d/src/test/javascript/render/curvedLine.html delete mode 100755 web2d/src/test/javascript/render/events.html delete mode 100644 web2d/src/test/javascript/render/font.html delete mode 100755 web2d/src/test/javascript/render/group.html delete mode 100755 web2d/src/test/javascript/render/line.html delete mode 100755 web2d/src/test/javascript/render/polyLine.html delete mode 100755 web2d/src/test/javascript/render/prototype.html delete mode 100755 web2d/src/test/javascript/render/rect.html delete mode 100755 web2d/src/test/javascript/render/shapes.html delete mode 100755 web2d/src/test/javascript/render/text.html delete mode 100755 web2d/src/test/javascript/render/utils.js delete mode 100755 web2d/src/test/javascript/render/workspace.html delete mode 100644 wise-editor/doc/ConfigParameters.md delete mode 100644 wise-editor/doc/ImplementingPersistence.md delete mode 100644 wise-editor/doc/Integration.md delete mode 100644 wise-editor/pom.xml delete mode 100644 wise-editor/src/main/resources/web.xml delete mode 100644 wise-editor/src/main/webapp/WEB-INF/web.xml delete mode 120000 wise-editor/src/main/webapp/bootstrap delete mode 100644 wise-editor/src/main/webapp/c/export.htm delete mode 100644 wise-editor/src/main/webapp/c/map/export.htm delete mode 100644 wise-editor/src/main/webapp/c/publish.htm delete mode 120000 wise-editor/src/main/webapp/css/widget/colorPalette.css delete mode 120000 wise-editor/src/main/webapp/css/widget/colorPalette.html delete mode 100644 wise-editor/src/main/webapp/html/container.html delete mode 100644 wise-editor/src/main/webapp/html/container.json delete mode 100644 wise-editor/src/main/webapp/html/drag.html delete mode 100644 wise-editor/src/main/webapp/html/editor.html delete mode 100644 wise-editor/src/main/webapp/html/embedded.html delete mode 100644 wise-editor/src/main/webapp/html/viewmode.html delete mode 100644 wise-editor/src/main/webapp/index.html delete mode 120000 wise-editor/src/main/webapp/js/bootstrap.js delete mode 120000 wise-editor/src/main/webapp/js/core.js delete mode 100644 wise-editor/src/main/webapp/js/editor.js delete mode 120000 wise-editor/src/main/webapp/js/hotkeys.js delete mode 120000 wise-editor/src/main/webapp/js/jquery-mousewheel.js delete mode 120000 wise-editor/src/main/webapp/js/jquery.js delete mode 120000 wise-editor/src/main/webapp/js/less.js delete mode 100644 wise-editor/src/main/webapp/js/mindplot-min.js delete mode 120000 wise-editor/src/main/webapp/js/mootools-core.js delete mode 120000 wise-editor/src/main/webapp/js/underscore.js delete mode 120000 wise-editor/src/main/webapp/js/underscorejs.js delete mode 100644 wise-editor/src/main/webapp/samples/complex.xml delete mode 100644 wise-editor/src/main/webapp/samples/emptyNodes.xml delete mode 100644 wise-editor/src/main/webapp/samples/huge.xml delete mode 100644 wise-editor/src/main/webapp/samples/issue.xml delete mode 100644 wise-editor/src/main/webapp/samples/sample2.xml delete mode 100644 wise-editor/src/main/webapp/samples/sample3.xml delete mode 100644 wise-editor/src/main/webapp/samples/sample4.xml delete mode 100644 wise-editor/src/main/webapp/samples/welcome-reloaded.xml delete mode 100644 wise-editor/src/main/webapp/samples/welcome.xml create mode 100644 wise-ui/pom.xml delete mode 100644 wise-webapp/src/main/java/com/wisemapping/exceptions/GoogleChromeFrameRequiredException.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/exceptions/UnsupportedBrowserException.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/filter/BrowserSupportInterceptor.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/UserController.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/rest/model/RestUserRegistration.java create mode 100644 wise-webapp/src/main/java/com/wisemapping/service/RegistrationException.java delete mode 100644 wise-webapp/src/main/java/com/wisemapping/webmvc/ExtensionsController.java delete mode 100644 wise-webapp/src/main/resources/bootstrap/12px/bootstrap3.1.tar.gz delete mode 100644 wise-webapp/src/main/resources/bootstrap/13px/bootstrap3.1.tar.gz delete mode 120000 wise-webapp/src/main/webapp/bootstrap create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap-colorpicker.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap-colorpicker.min.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap-theme.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap-theme.css.map create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap-theme.min.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap.css.map create mode 100644 wise-webapp/src/main/webapp/bootstrap/css/bootstrap.min.css create mode 100644 wise-webapp/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.eot create mode 100644 wise-webapp/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.svg create mode 100644 wise-webapp/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.ttf create mode 100644 wise-webapp/src/main/webapp/bootstrap/fonts/glyphicons-halflings-regular.woff create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/bootstrap-colorpicker/alpha-horizontal.png create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/bootstrap-colorpicker/alpha.png create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/bootstrap-colorpicker/hue-horizontal.png create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/bootstrap-colorpicker/hue.png create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/bootstrap-colorpicker/saturation.png create mode 100644 wise-webapp/src/main/webapp/bootstrap/img/glyphicons-halflings-blue.png rename {mindplot/src/main/javascript/libraries/bootstrap => wise-webapp/src/main/webapp}/css/bootstrap.min.css (100%) rename {wise-editor => wise-webapp}/src/main/webapp/css/compatibility.less (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/css}/css/embedded.less (100%) rename wise-webapp/src/main/webapp/css/{ => css}/pageHeaders.css (100%) rename wise-webapp/src/main/webapp/css/{ => css}/pageTemplate.css (100%) create mode 100644 wise-webapp/src/main/webapp/css/css/skin.less rename {wise-editor => wise-webapp}/src/main/webapp/css/editor.less (98%) delete mode 120000 wise-webapp/src/main/webapp/css/embedded.less rename {wise-editor => wise-webapp}/src/main/webapp/css/header.less (100%) delete mode 100644 wise-webapp/src/main/webapp/css/mindmapList.less rename {wise-editor => wise-webapp}/src/main/webapp/css/toolbar.less (86%) rename {mindplot/src/main/javascript => wise-webapp/src/main/webapp/css}/widget/colorPalette.css (100%) rename {mindplot/src/main/javascript => wise-webapp/src/main/webapp/css}/widget/colorPalette.html (100%) rename {wise-editor => wise-webapp}/src/main/webapp/css/widget/skin2.less (100%) delete mode 100755 wise-webapp/src/main/webapp/doc/rest/css/highlight.default.css delete mode 100755 wise-webapp/src/main/webapp/doc/rest/css/screen.css delete mode 100755 wise-webapp/src/main/webapp/doc/rest/images/throbber.gif delete mode 100755 wise-webapp/src/main/webapp/doc/rest/index.html delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/backbone-min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/handlebars-1.0.0.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/highlight.7.3.pack.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/jquery-1.8.0.min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/jquery.ba-bbq.min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/jquery.slideto.min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/jquery.wiggle.min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/shred.bundle.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/shred/content.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/swagger.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/lib/underscore-min.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/swagger-ui.js delete mode 100755 wise-webapp/src/main/webapp/doc/rest/swagger-ui.min.js delete mode 100644 wise-webapp/src/main/webapp/favicon.ico rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_down.gif (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_down.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_left.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_merge.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_right.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrow_up.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrowc_rotate_anticlockwise.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrowc_rotate_clockwise.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrowc_turn_left.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/arrowc_turn_right.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bomb.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bulb_light_off.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bulb_light_on.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_black.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_blue.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_green.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_orange.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_pink.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_purple.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/bullet_red.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/chart_bar.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/chart_curve.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/chart_line.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/chart_organisation.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/chart_pie.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/close.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/conn_connect.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/conn_disconnect.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_crying.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_plain.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_sad.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_smile-big.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_smile.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_surprise.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/face_wink.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_blue.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_green.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_orange.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_pink.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_purple.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/flag_yellow.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_angel.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_devilish.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_glasses.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_grin.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_kiss.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/funy_monkey.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/gener_female.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/gener_male.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_cd.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_computer.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_controller.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_drive_cd.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_driver_disk.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_ipod.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_keyboard.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_mouse.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/hard_printer.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/lock_close.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/lock_open.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/mail_edit.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/mail_envelop.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/mail_list.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/mail_mailbox.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/money_coins.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/money_dollar.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/money_euro.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/money_money.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/money_pound.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/money_ruby.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/money_yen.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_1.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_2.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_3.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_4.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_5.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_6.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_7.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_8.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/number_9.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_bell.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_cake.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_camera.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_clanbomber.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_clip.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_house.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_key.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_magnifier.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_music.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_palette.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_pencil.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_phone.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_rainbow.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_star.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/object_wizard.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_add.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_clock.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_clock_red.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_delete.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_status_offline.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/onoff_status_online.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/people_female1.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/people_female2.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/people_group.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/people_male1.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/people_male2.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_cancel.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_closed.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_exclamation.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_help.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_info.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_stop.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sign_warning.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_bug.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_cursor.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_database.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_database_table.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_feed.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_folder_explore.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_penguin.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_rss.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/soft_stuff_folder.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_basketball.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_football.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_golf.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_raquet.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_shuttlecock.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_soccer.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/sport_tennis.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_blue.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_blue_add.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_blue_add2.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_green.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_orange.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_pink.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_purple.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_red.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/icons}/tag_yellow.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/task_0.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/task_100.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/task_25.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/task_50.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/task_75.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/thumb_thumb_down.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/thumb_thumb_up.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/tick_cross.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/tick_tick.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/time_calendar.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/time_clock.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/time_hourglass.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_clear-night.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_clear.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_few-clouds-night.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_few-clouds.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_overcast.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_severe-alert.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_showers-scattered.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_showers.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_snow.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/icons/weather_storm.png (100%) rename {wise-editor => wise-webapp}/src/main/webapp/images/alert-sign.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/ajax-loader.gif (100%) create mode 100644 wise-webapp/src/main/webapp/images/editor/alert-sign.png rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/btn-bg-hover.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/btn-bg-normal.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/btne-bg-hover.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/btne-bg-normal.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/btne-bg-selected.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/discard.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/editortoolbar.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/export.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/favicon.ico (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/font-bold.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/font-color.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/font-italic.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/font-size.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/font-type.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/history.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/links.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/logo-135x135.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/logo-head-only.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/logo-medium.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/logo-small.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/logo-xsmall.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/notes.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/print.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/public.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/redo.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/save.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/shape-circle.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/shape-line.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/shape-rectangle-round.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/shape-rectangle.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/share.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/tag.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-add.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-border.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-color.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-delete.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-icon.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-link.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-note.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-relation.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/topic-shape.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/undo.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/zoom-in.png (100%) rename {wise-editor/src/main/webapp/images => wise-webapp/src/main/webapp/images/editor}/zoom-out.png (100%) delete mode 100644 wise-webapp/src/main/webapp/images/favicon.ico delete mode 100644 wise-webapp/src/main/webapp/images/html5-badge-h-graphics.png create mode 100644 wise-webapp/src/main/webapp/images/links.png create mode 100644 wise-webapp/src/main/webapp/images/notes.png delete mode 100644 wise-webapp/src/main/webapp/images/openid-providers-en.png create mode 100644 wise-webapp/src/main/webapp/images/shape-circle.png create mode 100644 wise-webapp/src/main/webapp/images/shape-line.png create mode 100644 wise-webapp/src/main/webapp/images/shape-rectangle-round.png create mode 100644 wise-webapp/src/main/webapp/images/shape-rectangle.png delete mode 100644 wise-webapp/src/main/webapp/images/sort_asc.png delete mode 100644 wise-webapp/src/main/webapp/images/sort_asc_disabled.png delete mode 100644 wise-webapp/src/main/webapp/images/sort_both.png delete mode 100644 wise-webapp/src/main/webapp/images/sort_desc.png delete mode 100644 wise-webapp/src/main/webapp/images/sort_desc_disabled.png delete mode 100644 wise-webapp/src/main/webapp/images/star-off-hover.png delete mode 100644 wise-webapp/src/main/webapp/images/star-off.png delete mode 100644 wise-webapp/src/main/webapp/images/star-on-hover.png delete mode 100644 wise-webapp/src/main/webapp/images/star-on.png delete mode 100644 wise-webapp/src/main/webapp/js/jquery.dataTables.min.js delete mode 120000 wise-webapp/src/main/webapp/js/jquery.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.ca.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.de.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.en.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.en_us.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.es.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.fr.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.pt.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.zh_cn.js delete mode 100644 wise-webapp/src/main/webapp/js/jquery.timeago.zh_tw.js mode change 120000 => 100755 wise-webapp/src/main/webapp/js/less.js delete mode 100644 wise-webapp/src/main/webapp/js/mindmapList.js delete mode 120000 wise-webapp/src/main/webapp/js/mootools-core.js delete mode 120000 wise-webapp/src/main/webapp/js/underscorejs.js delete mode 100755 wise-webapp/src/main/webapp/jsp/accountSettings.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/activationAccountConfirmation.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/activationAccountConfirmationFail.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/browserNotSupported.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/footer.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/header.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/homepage.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/labelIconList.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/login.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapDetail.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapExport.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/mindmapHistory.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapImport.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapList.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapPublish.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/mindmapShare.jsp create mode 100644 wise-webapp/src/main/webapp/jsp/reactInclude.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/termsOfUse.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/userForgotPassword.jsp delete mode 100755 wise-webapp/src/main/webapp/jsp/userForgotPasswordError.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/userForgotPasswordSuccess.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/userRegistration.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/userRegistrationSuccess.jsp create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/arrow_down.gif rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/arrow_down.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/arrow_left.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/arrow_merge.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/arrow_right.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/arrow_up.png (100%) rename wise-editor/src/main/webapp/icons/legacy/arrow_rotate_anticlockwise.png => wise-webapp/src/main/webapp/map-icons/icons/arrowc_rotate_anticlockwise.png (100%) rename wise-editor/src/main/webapp/icons/legacy/arrow_rotate_clockwise.png => wise-webapp/src/main/webapp/map-icons/icons/arrowc_rotate_clockwise.png (100%) rename wise-editor/src/main/webapp/icons/legacy/arrow_turn_left.png => wise-webapp/src/main/webapp/map-icons/icons/arrowc_turn_left.png (100%) rename wise-editor/src/main/webapp/icons/legacy/arrow_turn_right.png => wise-webapp/src/main/webapp/map-icons/icons/arrowc_turn_right.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/bomb.png rename wise-editor/src/main/webapp/icons/legacy/lightbulb_off.png => wise-webapp/src/main/webapp/map-icons/icons/bulb_light_off.png (100%) mode change 100755 => 100644 rename wise-editor/src/main/webapp/icons/legacy/lightbulb.png => wise-webapp/src/main/webapp/map-icons/icons/bulb_light_on.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_black.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_blue.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_green.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_orange.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_pink.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_purple.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/bullet_red.png (100%) mode change 100755 => 100644 rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/chart_bar.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/chart_curve.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/chart_line.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/chart_organisation.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/chart_pie.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/close.png (100%) rename wise-editor/src/main/webapp/icons/legacy/connect.png => wise-webapp/src/main/webapp/map-icons/icons/conn_connect.png (100%) mode change 100755 => 100644 rename wise-editor/src/main/webapp/icons/legacy/disconnect.png => wise-webapp/src/main/webapp/map-icons/icons/conn_disconnect.png (100%) mode change 100755 => 100644 rename wise-editor/src/main/webapp/icons/legacy/face-crying.png => wise-webapp/src/main/webapp/map-icons/icons/face_crying.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-plain.png => wise-webapp/src/main/webapp/map-icons/icons/face_plain.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-sad.png => wise-webapp/src/main/webapp/map-icons/icons/face_sad.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-smile-big.png => wise-webapp/src/main/webapp/map-icons/icons/face_smile-big.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-smile.png => wise-webapp/src/main/webapp/map-icons/icons/face_smile.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-surprise.png => wise-webapp/src/main/webapp/map-icons/icons/face_surprise.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-wink.png => wise-webapp/src/main/webapp/map-icons/icons/face_wink.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_blue.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_green.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_orange.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_pink.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_purple.png (100%) rename {wise-editor/src/main/webapp/icons/legacy => wise-webapp/src/main/webapp/map-icons/icons}/flag_yellow.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-angel.png => wise-webapp/src/main/webapp/map-icons/icons/funy_angel.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-devilish.png => wise-webapp/src/main/webapp/map-icons/icons/funy_devilish.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-glasses.png => wise-webapp/src/main/webapp/map-icons/icons/funy_glasses.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-grin.png => wise-webapp/src/main/webapp/map-icons/icons/funy_grin.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-kiss.png => wise-webapp/src/main/webapp/map-icons/icons/funy_kiss.png (100%) rename wise-editor/src/main/webapp/icons/legacy/face-monkey.png => wise-webapp/src/main/webapp/map-icons/icons/funy_monkey.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/gener_female.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/gener_male.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_cd.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_computer.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_controller.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_drive_cd.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_driver_disk.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_ipod.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_keyboard.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_mouse.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/hard_printer.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/add.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_down.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_left.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_merge.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_right.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_rotate_anticlockwise.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_rotate_clockwise.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_turn_left.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_turn_right.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/arrow_up.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/backColor.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/balloon.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/bin.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/black-keyboard.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/bold.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/borderColor.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_black.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_blue.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_green.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_orange.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_pink.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_purple.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/bullet_red.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/chart_bar.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/chart_curve.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/chart_line.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/chart_organisation.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/chart_pie.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/clock.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/clock_red.png (100%) create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/close.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/coins.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/collab_publish.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/collab_share.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/collab_tag.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/color_swatch.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/comment.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/connect.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/cross.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/delNode.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/delete.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/disconnect.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-angel.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-crying.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-devilish.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-glasses.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-grin.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-kiss.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-monkey.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-plain.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-sad.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-smile-big.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-smile.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-surprise.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/legacy/face-wink.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_export.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_printer.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_redo.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_redo_dis.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_undo.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/file_undo_dis.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_blue.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_green.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_orange.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_pink.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_purple.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/flag_yellow.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/fontColor.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/fontSize.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font_bold.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font_color.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font_italic.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font_size.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/font_type.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/group.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/group2.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/group_go.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/help.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/history.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/info.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/italic.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/key.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/lightbulb.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/legacy/lightbulb_off.png rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/links.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/lock.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/lock_open.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/logo-big.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/logo-vsmall.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/logo-vvsmall.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/marca-vsmall.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/money.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/money_dollar.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/money_euro.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/money_pound.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/money_yen.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/moor_boverlay.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/moor_slider.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/moor_woverlay.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/move.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/mymaps.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/node_add.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/node_border.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/node_border2.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/node_elipse.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/note.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/note1.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/page_delete.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/page_go.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/printer.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/removeUser.jpeg (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/ruby.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/save.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/search.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/search2.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/search3.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/seast.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape-elipse.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape-line.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape-rectangle-rounded.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape-rectangle.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape_handles.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape_square_add.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape_square_delete.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/shape_square_edit.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/signUpBodyBtn.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/signUpEndBtn.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/signUpStartBtn.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/sne.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/snorth.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/snw.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/sse.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/ssouth.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/ssw.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/swest.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_blue.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_blue_add.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_blue_add2.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_green.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_orange.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_pink.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_purple.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_red.png (100%) rename {wise-editor/src/main/webapp/icons => wise-webapp/src/main/webapp/map-icons/icons/legacy}/tag_yellow.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/text_bold.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/text_italic.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/thumb_down.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/thumb_up.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/tick.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/user_delete.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/waring_icon.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/world.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/world2.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/world_go.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/world_link.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/zoom_in.png (100%) rename {wise-editor/src/main/webapp => wise-webapp/src/main/webapp/map-icons}/icons/legacy/zoom_out.png (100%) create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/lock_close.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/lock_open.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/mail_edit.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/mail_envelop.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/mail_list.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/mail_mailbox.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/money_coins.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/money_dollar.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/money_euro.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/money_money.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/money_pound.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/money_ruby.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/money_yen.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_1.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_2.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_3.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_4.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_5.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_6.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_7.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_8.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/number_9.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_bell.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_cake.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_camera.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_clanbomber.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_clip.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_house.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_key.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_magnifier.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_music.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_palette.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_pencil.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_phone.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_rainbow.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_star.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/object_wizard.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/onoff_add.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/onoff_clock.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/onoff_clock_red.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/onoff_delete.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/onoff_status_offline.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/onoff_status_online.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/people_female1.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/people_female2.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/people_group.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/people_male1.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/people_male2.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_cancel.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_closed.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_exclamation.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_help.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_info.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_stop.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/sign_warning.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_bug.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_cursor.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_database.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_database_table.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_feed.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_folder_explore.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_penguin.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_rss.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/soft_stuff_folder.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_basketball.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_football.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_golf.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_raquet.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_shuttlecock.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_soccer.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/sport_tennis.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_blue.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_blue_add.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_blue_add2.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_green.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_orange.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_pink.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_purple.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_red.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/tag_yellow.png rename mindplot/src/main/javascript/libraries/bootstrap/img/bootstrap-colorpicker/alpha.png => wise-webapp/src/main/webapp/map-icons/icons/task_0.png (82%) mode change 100644 => 100755 rename mindplot/src/main/javascript/libraries/bootstrap/img/bootstrap-colorpicker/hue.png => wise-webapp/src/main/webapp/map-icons/icons/task_100.png (83%) mode change 100644 => 100755 create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/task_25.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/task_50.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/task_75.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/thumb_thumb_down.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/thumb_thumb_up.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/tick_cross.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/tick_tick.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/time_calendar.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/time_clock.png create mode 100755 wise-webapp/src/main/webapp/map-icons/icons/time_hourglass.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_clear-night.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_clear.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_few-clouds-night.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_few-clouds.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_overcast.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_severe-alert.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_showers-scattered.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_showers.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_snow.png create mode 100644 wise-webapp/src/main/webapp/map-icons/icons/weather_storm.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/alert-sign.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/links.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/notes.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/shape-circle.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/shape-line.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/shape-rectangle-round.png create mode 100644 wise-webapp/src/main/webapp/map-icons/images/shape-rectangle.png create mode 120000 wise-webapp/src/main/webapp/static/mindplot create mode 120000 wise-webapp/src/main/webapp/static/webapp create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 13b5c4c9..1762a2b7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ wisemapping.log* .DS_Store target .idea +wise-webapp/src/main/webapp/react/* diff --git a/README.md b/README.md index bfea037e..acc9591c 100644 --- a/README.md +++ b/README.md @@ -8,50 +8,58 @@ The goal of this project is to provide a high quality product that can be deploy The following products must be installed: - * Java Development Kit 8 or higher ([http://www.oracle.com/technetwork/java/javase/downloads/index.html]) + * Java 11 to 16 * Maven 3.x or higher ([http://maven.apache.org/]) ### Compiling WiseMapping uses Maven as packaging and project management. It's composed of 5 maven sub-modules: - * core-js: Utilities JavaScript classes - * web2d: JavaScript 2D SVG abstraction library used by the mind map editor - * mindplot: JavaScript mindmap designer core - * wise-editor: Mindmap Editor standalone distribution + * wise-react: React font-end fetcher * wise-webapp: J2EE web application The full compilation of the project can be performed executing within : -`mvn package` +`export MAVEN_OPTS="--illegal-access=permit"` +`mvn clean install` -Once this command is execute, the file /wise-webapp/target/wisemapping*.war will be generated. +Once this command is executed, the file /wise-webapp/target/wisemapping*.war will be generated. + +### Local Development +The previously generated war can be deployed locally executing within the directory /wise-webapp the following command: + +`cd wise-webapp;mvn jetty:run-war` + +This will start the application on the URL: [http://localhost:8080/] using file based database. + +User: test@wisemapping.org +Password: test + +### Local Development - UI Integration + +In order to reduce the life-cycle to develop UI backend testing, you can do the following hack: + +* Clone [https://bitbucket.org/wisemapping/wisemapping-open-source/] and [https://bitbucket.org/wisemapping/wisemapping-frontend/] at the same top level directory +* Compile `WiseMapping Frontend` +* Compile `WiseMapping Open Source` +* Follow the Local Testing steps. ### Compiling and running with docker-compose Check out the [docker section](./docker/README.md) -### Testing -The previously generated war can be deployed locally executing within the directory /wise-webapp the following command: - -`cd wise-webapp;mvn jetty:run-war` - -This will start the application on the URL: [http://localhost:8080/] using file based database.. - -User: test@wisemapping.org -Password: test ## Running the JS only version -Start by creating the .zip file: +Start by creating the .zip file. `mvn assembly:assembly -Dmaven.test.skip=true` -To test the javascript frontend you then do: +To test the javascript frontend, install a simple http-server. - ruby -rwebrick -e 'WEBrick::HTTPServer.new(:Port=>8000,:DocumentRoot=>".").start' +`npm install -g http-server` -Now open a browser using the URL http://localhost:8000/wise-editor/src/main/webapp/ +Now open a browser using the URL http://localhost:8080/wise-editor/src/main/webapp/ ## Troubleshooting @@ -77,18 +85,18 @@ Now open a browser using the URL http://localhost:8000/wise-editor/src/main/weba ### Founders - * Pablo Luna * Paulo Veiga + * Pablo Luna -### Individual Controbutors +### Individual Contributors * Ezequiel Bergamaschi - * Claudio Barril ### Past Individual Contributors * Ignacio Manzano * Nicolas Damonte + * Claudio Barril ## License diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 6e5e5a54..3d77cb7d 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -14,7 +14,15 @@ pipelines: name: Build and Test caches: - maven + - node script: + - curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash + - . $HOME/.nvm/nvm.sh && nvm install node + - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 || true + - export PATH=$HOME/.yarn/bin:$PATH + # Workaround for jaxb plugin bug on java 11 or higher. + - export MAVEN_OPTS="--illegal-access=permit" + - yarn --version - mvn -B verify --file pom.xml install after-script: # Collect checkstyle results, if any, and convert to Bitbucket Code Insights. @@ -25,3 +33,7 @@ pipelines: # Run a security scan for sensitive data. # See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security - pipe: atlassian/git-secrets-scan:0.4.3 + - step: + runs-on: self.hosted + script: echo hello + diff --git a/core-js/pom.xml b/core-js/pom.xml deleted file mode 100644 index 4ab4e1e6..00000000 --- a/core-js/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 4.0.0 - core-js - jar - Core JavaScript Utils Libraries - - - org.wisemapping - wisemapping - ../pom.xml - 5.0.2-SNAPSHOT - - - scm:git:git@bitbucket.org:wisemapping/wisemapping-open-source.git - - - - - - maven-antrun-plugin - - - merge-js-resources - generate-resources - - run - - - - - - - - - - - - org.apache.maven.plugins - maven-release-plugin - 2.5 - - - com.github.searls - jasmine-maven-plugin - 1.3.1.5 - - - - test - - - - - - Functions.js - - - - - net.alchim31.maven - yuicompressor-maven-plugin - - - generate-resources - - compress - - - src/main/javascript/ - target/tmp/ - - - ${basedir}/target/classes/core.js - - ${basedir}/target/tmp/header-min.js - ${basedir}/target/tmp/Functions-min.js - ${basedir}/target/tmp/Utils-min.js - ${basedir}/../mindplot/src/main/javascript/Options.js - ${basedir}/../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js - ${basedir}/../mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js - - - - true - false - true - - - - - - - diff --git a/core-js/src/main/javascript/Functions.js b/core-js/src/main/javascript/Functions.js deleted file mode 100644 index d6faa88d..00000000 --- a/core-js/src/main/javascript/Functions.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - Function: $defined - Returns true if the passed in value/object is defined, that means is not null or undefined. - - Arguments: - obj - object to inspect - */ - -$defined = function (obj) { - return (obj != undefined); -}; - - -$assert = function (assert, message) { - if (!$defined(assert) || !assert) { - logStackTrace(); - console.log(message); - throw new Error(message); - } -}; - -Math.sign = function (value) { - return (value >= 0) ? 1 : -1; -}; - -function logStackTrace(exception) { - - if (!$defined(exception)) { - try { - throw Error("Unexpected Exception"); - } catch (e) { - exception = e; - } - } - var result = ""; - if (exception.stack) { //Firefox and Chrome... - result = exception.stack; - } - else if (window.opera && exception.message) { //Opera - result = exception.message; - } else { //IE and Safari - result = exception.sourceURL + ': ' + exception.line + "\n\n"; - - var currentFunction = arguments.callee.caller; - while (currentFunction) { - var fn = currentFunction.toString(); - result = result + "\n" + fn; - currentFunction = currentFunction.caller; - } - } - window.errorStack = result; - return result; -} - -// Support for Windows ... -if (!window.console) { - console = { - log:function (e) { - - } - }; -} \ No newline at end of file diff --git a/core-js/src/main/javascript/Utils.js b/core-js/src/main/javascript/Utils.js deleted file mode 100644 index 57e416f5..00000000 --- a/core-js/src/main/javascript/Utils.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -core.Utils = { - -}; - - -core.Utils.innerXML = function (node) { - // summary: - // Implementation of MS's innerXML function. - if ($defined(node.innerXML)) { - return node.innerXML; - // string - } else if ($defined(node.xml)) { - return node.xml; - // string - } else if ($defined(XMLSerializer)) { - return (new XMLSerializer()).serializeToString(node); - // string - } -}; - -/** - * Cross-browser implementation of creating an XML document object. - */ -core.Utils.createDocument = function () { - var doc = null; - if ($defined(window.ActiveXObject)) { - //http://blogs.msdn.com/b/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx - var progIDs = [ 'Msxml2.DOMDocument.6.0', 'Msxml2.DOMDocument.3.0']; - for (var i = 0; i < progIDs.length; i++) { - try { - doc = new ActiveXObject(progIDs[i]); - break; - } - catch (ex) { - } - } - } else if (window.document.implementation && window.document.implementation.createDocument) { - doc = window.document.implementation.createDocument("", "", null); - } - $assert(doc, "Parser could not be instantiated"); - - return doc; -}; \ No newline at end of file diff --git a/core-js/src/main/javascript/header.js b/core-js/src/main/javascript/header.js deleted file mode 100644 index d3284d3a..00000000 --- a/core-js/src/main/javascript/header.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright [2015] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* 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. -*/ - -var core = {}; diff --git a/core-js/src/test/javascript/testSuite.js b/core-js/src/test/javascript/testSuite.js deleted file mode 100644 index 760d0aab..00000000 --- a/core-js/src/test/javascript/testSuite.js +++ /dev/null @@ -1,10 +0,0 @@ -describe("Functions suite test", function() { - it("$defined() test spec", function() { - var testVariable = undefined; - expect($defined(testVariable)).toBe(false); - testVariable = 1; - expect($defined(testVariable)).toBe(true); - testVariable = null; - expect($defined(testVariable)).toBe(false); - }); -}); diff --git a/mindplot/pom.xml b/mindplot/pom.xml deleted file mode 100644 index b2e2388e..00000000 --- a/mindplot/pom.xml +++ /dev/null @@ -1,427 +0,0 @@ - - - 4.0.0 - mindplot - jar - Mindmap Draw JavaScript Library - - - org.wisemapping - wisemapping - ../pom.xml - 5.0.2-SNAPSHOT - - - - - org.wisemapping - web2d - ${com.wisemapping.version} - runtime - - - - - - - jstd-maven-plugin google code repo - http://jstd-maven-plugin.googlecode.com/svn/maven2 - - - - - - - org.codehaus.gmaven - gmaven-plugin - 1.4 - - - - generate-resources - - execute - - - - def outdir = new File(project.basedir, 'src/main/javascript'); - if (project.packaging != 'pom') { - def dir = new File(project.basedir, 'src/main/resources/'); - - dir.eachFile { file -> - def matcher = file.name =~ /messages_(.+)\.properties/; - def lang = matcher[0][1]; - def outfile = new File(outdir, "MessageBundle_${lang}.js"); - println "Converting ${file.name} to ${outfile.name}"; - - outfile.withWriter('UTF-8') { out -> - out.writeLine "mindplot.Messages.BUNDLES['${lang.toLowerCase()}'] = { "; - file.eachLine('UTF-8') { line -> - if (line.trim() != "" && line[0] != '#') { - matcher = line =~ /(.+)=(.+)/; - out.writeLine("'${matcher[0][1]}' : \"${matcher[0][2]}\","); - } - } - out.writeLine("'DUMMY' : '' "); - out.writeLine "};" - } - } - } - - - - - - - maven-antrun-plugin - - - merge-js-resources - generate-resources - - run - - - - - - - - - - - - - - - - - - net.alchim31.maven - yuicompressor-maven-plugin - - - generate-resources - - compress - - - ${basedir}/src/main/javascript - ${basedir}/target/compress/ - true - - libraries/**/*.js - - - - ${project.build.directory}/classes/mindplot-min.js - ${basedir}/target/compress - - header.js - Events.js - Options.js - ${basedir}/../web2d/target/classes/web2d.svg-min.js - Messages.js - TopicEventDispatcher.js - model/IMindmap.js - model/Mindmap.js - model/INodeModel.js - model/NodeModel.js - model/RelationshipModel.js - ActionDispatcher.js - StandaloneActionDispatcher.js - DesignerModel.js - Designer.js - ScreenManager.js - Workspace.js - ShrinkConnector.js - Keyboard.js - DesignerKeyboard.js - Keyboard.js - TopicStyle.js - NodeGraph.js - Topic.js - CentralTopic.js - MainTopic.js - DragTopic.js - DragManager.js - DragPivot.js - ConnectionLine.js - Relationship.js - DragConnector.js - TextEditor.js - MultilineTextEditor.js - TextEditorFactory.js - util/Shape.js - util/FadeEffect.js - persistence/ModelCodeName.js - persistence/XMLSerializer_Pela.js - persistence/XMLSerializer_Tango.js - persistence/Pela2TangoMigrator.js - persistence/XMLSerializer_Beta.js - persistence/Beta2PelaMigrator.js - persistence/XMLSerializerFactory.js - PersistenceManager.js - RestPersistenceManager.js - LocalStorageManager.js - EditorProperties.js - IconGroup.js - Icon.js - LinkIcon.js - NoteIcon.js - ActionIcon.js - ImageIcon.js - model/FeatureModel.js - model/IconModel.js - model/LinkModel.js - model/NoteModel.js - Command.js - DesignerActionRunner.js - DesignerUndoManager.js - ControlPoint.js - EditorOptions.js - RelationshipPivot.js - TopicFeature.js - commands/GenericFunctionCommand.js - commands/DeleteCommand.js - commands/DragTopicCommand.js - commands/AddTopicCommand.js - commands/ChangeFeatureToTopicCommand.js - commands/RemoveFeatureFromTopicCommand.js - commands/AddFeatureToTopicCommand.js - commands/AddRelationshipCommand.js - commands/MoveControlPointCommand.js - widget/ModalDialogNotifier.js - widget/ToolbarNotifier.js - widget/ToolbarItem.js - widget/ToolbarPaneItem.js - widget/NoteEditor.js - widget/LinkEditor.js - widget/FloatingTip.js - widget/LinkIconTooltip.js - widget/KeyboardShortcutTooltip.js - widget/ColorPalettePanel.js - widget/ListToolbarPanel.js - widget/FontFamilyPanel.js - widget/FontSizePanel.js - widget/TopicShapePanel.js - widget/IconPanel.js - widget/IMenu.js - widget/Menu.js - TopicFeature.js - layout/EventBusDispatcher.js - layout/ChangeEvent.js - layout/LayoutManager.js - layout/Node.js - layout/RootedTreeSet.js - layout/ChildrenSorterStrategy.js - layout/AbstractBasicSorter.js - layout/BalancedSorter.js - layout/SymmetricSorter.js - layout/GridSorter.js - layout/OriginalLayout.js - layout/EventBus.js - MessageBundle_en.js - MessageBundle_es.js - MessageBundle_de.js - MessageBundle_fr.js - MessageBundle_pt_BR.js - MessageBundle_zh_CN.js - MessageBundle_zh_TW.js - MessageBundle_ca.js - footer.js - - - - false - false - UTF-8 - false - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - com.github.searls - jasmine-maven-plugin - 1.3.1.5 - - - - - - - - - - net.sourceforge.htmlunit - htmlunit - 2.15 - - - - org.openqa.selenium.phantomjs.PhantomJSDriver - - - phantomjs.binary.path - ${phantomjs.binary} - - - - libraries/mootools/mootools-core-1.4.5-full-nocompat-yc.js - lib/jquery.js - lib/core.js/ - lib/web2d.svg-min.js - libraries/hotkeys/jquery.hotkeys.js - libraries/underscorejs/underscore-min.js - libraries/bootstrap/js/bootstrap.js - - - header.js - Events.js - Messages.js - TopicEventDispatcher.js - model/IMindmap.js - model/Mindmap.js - model/INodeModel.js - model/NodeModel.js - model/RelationshipModel.js - ActionDispatcher.js - StandaloneActionDispatcher.js - DesignerModel.js - Designer.js - ScreenManager.js - Workspace.js - ShrinkConnector.js - Keyboard.js - DesignerKeyboard.js - Keyboard.js - TopicStyle.js - NodeGraph.js - Topic.js - CentralTopic.js - MainTopic.js - DragTopic.js - DragManager.js - DragPivot.js - ConnectionLine.js - Relationship.js - DragConnector.js - TextEditor.js - MultilineTextEditor.js - TextEditorFactory.js - util/Shape.js - util/FadeEffect.js - persistence/ModelCodeName.js - persistence/XMLSerializer_Pela.js - persistence/XMLSerializer_Tango.js - persistence/Pela2TangoMigrator.js - persistence/XMLSerializer_Beta.js - persistence/Beta2PelaMigrator.js - persistence/XMLSerializerFactory.js - PersistenceManager.js - RestPersistenceManager.js - LocalStorageManager.js - EditorProperties.js - IconGroup.js - Icon.js - LinkIcon.js - NoteIcon.js - ActionIcon.js - ImageIcon.js - model/FeatureModel.js - model/IconModel.js - model/LinkModel.js - model/NoteModel.js - Command.js - DesignerActionRunner.js - DesignerUndoManager.js - ControlPoint.js - EditorOptions.js - RelationshipPivot.js - TopicFeature.js - commands/GenericFunctionCommand.js - commands/DeleteCommand.js - commands/DragTopicCommand.js - commands/AddTopicCommand.js - commands/ChangeFeatureToTopicCommand.js - commands/RemoveFeatureFromTopicCommand.js - commands/AddFeatureToTopicCommand.js - commands/AddRelationshipCommand.js - commands/MoveControlPointCommand.js - widget/ModalDialogNotifier.js - widget/ToolbarNotifier.js - widget/ToolbarItem.js - widget/ToolbarPaneItem.js - widget/NoteEditor.js - widget/LinkEditor.js - widget/FloatingTip.js - widget/LinkIconTooltip.js - widget/KeyboardShortcutTooltip.js - widget/ColorPalettePanel.js - widget/ListToolbarPanel.js - widget/FontFamilyPanel.js - widget/FontSizePanel.js - widget/TopicShapePanel.js - widget/IconPanel.js - widget/IMenu.js - widget/Menu.js - TopicFeature.js - layout/EventBusDispatcher.js - layout/ChangeEvent.js - layout/LayoutManager.js - layout/Node.js - layout/RootedTreeSet.js - layout/ChildrenSorterStrategy.js - layout/AbstractBasicSorter.js - layout/BalancedSorter.js - layout/SymmetricSorter.js - layout/GridSorter.js - layout/OriginalLayout.js - layout/EventBus.js - MessageBundle_en.js - MessageBundle_es.js - MessageBundle_de.js - MessageBundle_fr.js - MessageBundle_pt_BR.js - MessageBundle_zh_CN.js - MessageBundle_zh_TW.js - MessageBundle_ca.js - footer.js - - - static/test/*.js - simpleTest.js - - - - - com.github.klieber - phantomjs-maven-plugin - 0.5 - - - - install - - - - - 1.9.2 - - - - - diff --git a/mindplot/src/main/javascript/.gitignore b/mindplot/src/main/javascript/.gitignore deleted file mode 100644 index cc4e9f6e..00000000 --- a/mindplot/src/main/javascript/.gitignore +++ /dev/null @@ -1 +0,0 @@ -MessageBundle_* \ No newline at end of file diff --git a/mindplot/src/main/javascript/ActionDispatcher.js b/mindplot/src/main/javascript/ActionDispatcher.js deleted file mode 100644 index 33552e5f..00000000 --- a/mindplot/src/main/javascript/ActionDispatcher.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -//noinspection JSUnusedLocalSymbols -mindplot.ActionDispatcher = new Class({ - Implements:[mindplot.Events], - initialize: function(commandContext) { - $assert(commandContext, "commandContext can not be null"); - }, - - addRelationship: function(model, mindmap) { - throw "method must be implemented."; - }, - - addTopics: function(models, parentTopicId) { - throw "method must be implemented."; - }, - - deleteEntities: function(topicsIds, relIds) { - throw "method must be implemented."; - }, - - dragTopic: function(topicId, position, order, parentTopic) { - throw "method must be implemented."; - }, - - moveTopic: function(topicId, position) { - throw "method must be implemented."; - }, - - moveControlPoint: function(ctrlPoint, point) { - throw "method must be implemented."; - }, - - changeFontFamilyToTopic: function(topicIds, fontFamily) { - throw "method must be implemented."; - }, - - changeFontStyleToTopic: function(topicsIds) { - throw "method must be implemented."; - }, - - changeFontColorToTopic: function(topicsIds, color) { - throw "method must be implemented."; - }, - - changeFontSizeToTopic : function(topicsIds, size) { - throw "method must be implemented."; - }, - - changeBackgroundColorToTopic: function(topicsIds, color) { - throw "method must be implemented."; - }, - - changeBorderColorToTopic: function(topicsIds, color) { - throw "method must be implemented."; - }, - - changeShapeTypeToTopic : function(topicsIds, shapeType) { - throw "method must be implemented."; - }, - - changeFontWeightToTopic : function(topicsIds) { - throw "method must be implemented."; - }, - - changeTextToTopic : function(topicsIds, text) { - throw "method must be implemented."; - }, - - shrinkBranch : function(topicsIds, collapse) { - throw "method must be implemented."; - }, - - addFeatureToTopic : function(topicId, type, attributes) { - throw "method must be implemented."; - }, - - changeFeatureToTopic : function(topicId, featureId, attributes) { - throw "method must be implemented."; - }, - - removeFeatureFromTopic : function(topicId, featureId) { - throw "method must be implemented."; - } -}); - -mindplot.ActionDispatcher.setInstance = function(dispatcher) { - mindplot.ActionDispatcher._instance = dispatcher; -}; - -mindplot.ActionDispatcher.getInstance = function() { - return mindplot.ActionDispatcher._instance; -}; - diff --git a/mindplot/src/main/javascript/ActionIcon.js b/mindplot/src/main/javascript/ActionIcon.js deleted file mode 100644 index f22b1793..00000000 --- a/mindplot/src/main/javascript/ActionIcon.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ActionIcon = new Class({ - Extends:mindplot.Icon, - initialize: function(topic, url) { - this.parent(url); - this._node = topic; - }, - getNode:function() { - return this._node; - }, - - setPosition:function(x, y) { - var size = this.getSize(); - this.getImage().setPosition(x - size.width / 2, y - size.height / 2); - }, - - addEvent:function(event, fn) { - this.getImage().addEvent(event, fn); - }, - - addToGroup:function(group) { - group.append(this.getImage()); - }, - - setVisibility:function(visible) { - this.getImage().setVisibility(visible); - }, - - isVisible:function() { - return this.getImage().isVisible(); - }, - - setCursor:function(cursor) { - return this.getImage().setCursor(cursor); - }, - - moveToBack:function(cursor) { - return this.getImage().moveToBack(cursor); - }, - - moveToFront:function(cursor) { - return this.getImage().moveToFront(cursor); - } -}); - diff --git a/mindplot/src/main/javascript/CentralTopic.js b/mindplot/src/main/javascript/CentralTopic.js deleted file mode 100644 index 196a4029..00000000 --- a/mindplot/src/main/javascript/CentralTopic.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.CentralTopic = new Class(/** @lends CentralTopic*/{ - - Extends:mindplot.Topic, - /** - * @extends mindplot.Topic - * @constructs - * @param model - * @param options - */ - initialize:function (model, options) { - this.parent(model, options); - }, - - _registerEvents:function () { - this.parent(); - - // This disable the drag of the central topic. But solves the problem of deselecting the nodes when the screen is clicked. - this.addEvent('mousedown', function (event) { - event.stopPropagation(); - }); - }, - - /** */ - workoutIncomingConnectionPoint:function () { - return this.getPosition(); - }, - - /** */ - setCursor:function (type) { - type = (type == 'move') ? 'default' : type; - this.parent(type); - }, - - /** */ - updateTopicShape:function () { - - }, - - _updatePositionOnChangeSize:function () { - - // Center main topic ... - var zeroPoint = new core.Point(0, 0); - this.setPosition(zeroPoint); - }, - - /** */ - getShrinkConnector:function () { - return null; - }, - - /** */ - workoutOutgoingConnectionPoint:function (targetPosition) { - $assert(targetPosition, 'targetPoint can not be null'); - var pos = this.getPosition(); - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); - var size = this.getSize(); - return mindplot.util.Shape.calculateRectConnectionPoint(pos, size, !isAtRight); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/Command.js b/mindplot/src/main/javascript/Command.js deleted file mode 100644 index 9ea2cb8f..00000000 --- a/mindplot/src/main/javascript/Command.js +++ /dev/null @@ -1,65 +0,0 @@ -/* -* Copyright [2015] [wisemapping] -* -* Licensed under WiseMapping Public License, Version 1.0 (the "License"). -* It is basically the Apache License, Version 2.0 (the "License") plus the -* "powered by wisemapping" text requirement on every single page; -* you may not use this file except in compliance with the License. -* You may obtain a copy of the license at -* -* http://www.wisemapping.org/license -* -* 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. -*/ - -mindplot.Command = new Class(/** @lends mindplot.Command */{ - /** - * @classdesc The command base class for handling do/undo mindmap operations - * @constructs - */ - initialize: function() - { - this._id = mindplot.Command._nextUUID(); - }, - - /** - * @abstract - */ - execute: function(commandContext) - { - throw "execute must be implemented."; - }, - - /** - * Triggered by the undo button - reverses the executed command - * @abstract - */ - undoExecute: function(commandContext) - { - throw "undo must be implemented."; - }, - - /** - * Returns the unique id of this command - * @returns {Number} command id - */ - getId:function() - { - return this._id; - } -}); - -mindplot.Command._nextUUID = function() -{ - if (!$defined(mindplot.Command._uuid)) - { - mindplot.Command._uuid = 1; - } - - mindplot.Command._uuid = mindplot.Command._uuid + 1; - return mindplot.Command._uuid; -}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/ConnectionLine.js b/mindplot/src/main/javascript/ConnectionLine.js deleted file mode 100644 index 751894b3..00000000 --- a/mindplot/src/main/javascript/ConnectionLine.js +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ConnectionLine = new Class({ - initialize:function (sourceNode, targetNode, lineType) { - $assert(targetNode, 'parentNode node can not be null'); - $assert(sourceNode, 'childNode node can not be null'); - $assert(sourceNode != targetNode, 'Circular connection'); - - this._targetTopic = targetNode; - this._sourceTopic = sourceNode; - - var line; - var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode); - if (targetNode.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - line = this._createLine(lineType, mindplot.ConnectionLine.CURVED); - line.setSrcControlPoint(ctrlPoints[0]); - line.setDestControlPoint(ctrlPoints[1]); - } else { - line = this._createLine(lineType, mindplot.ConnectionLine.SIMPLE_CURVED); - line.setSrcControlPoint(ctrlPoints[0]); - line.setDestControlPoint(ctrlPoints[1]); - } - // Set line styles ... - var strokeColor = mindplot.ConnectionLine.getStrokeColor(); - line.setStroke(1, 'solid', strokeColor, 1); - line.setFill(strokeColor, 1); - - this._line2d = line; - }, - - _getCtrlPoints:function (sourceNode, targetNode) { - var srcPos = sourceNode.workoutOutgoingConnectionPoint(targetNode.getPosition()); - var destPos = targetNode.workoutIncomingConnectionPoint(sourceNode.getPosition()); - var deltaX = (srcPos.x - destPos.x) / 3; - return [new core.Point(deltaX, 0), new core.Point(-deltaX, 0)]; - }, - - _createLine:function (lineType, defaultStyle) { - if (!$defined(lineType)) { - lineType = defaultStyle; - } - lineType = parseInt(lineType); - this._lineType = lineType; - var line = null; - switch (lineType) { - case mindplot.ConnectionLine.POLYLINE: - line = new web2d.PolyLine(); - break; - case mindplot.ConnectionLine.CURVED: - line = new web2d.CurvedLine(); - break; - case mindplot.ConnectionLine.SIMPLE_CURVED: - line = new web2d.CurvedLine(); - line.setStyle(web2d.CurvedLine.SIMPLE_LINE); - break; - default: - line = new web2d.Line(); - break; - } - return line; - }, - - setVisibility:function (value) { - this._line2d.setVisibility(value); - }, - - isVisible:function () { - return this._line2d.isVisible(); - }, - - setOpacity:function (opacity) { - this._line2d.setOpacity(opacity); - }, - - redraw:function () { - var line2d = this._line2d; - var sourceTopic = this._sourceTopic; - var sourcePosition = sourceTopic.getPosition(); - - var targetTopic = this._targetTopic; - var targetPosition = targetTopic.getPosition(); - - var sPos, tPos; - sPos = sourceTopic.workoutOutgoingConnectionPoint(targetPosition); - tPos = targetTopic.workoutIncomingConnectionPoint(sourcePosition); - - line2d.setFrom(tPos.x, tPos.y); - line2d.setTo(sPos.x, sPos.y); - - if (line2d.getType() == "CurvedLine") { - var ctrlPoints = this._getCtrlPoints(this._sourceTopic, this._targetTopic); - line2d.setSrcControlPoint(ctrlPoints[0]); - line2d.setDestControlPoint(ctrlPoints[1]); - } - - // Add connector ... - this._positionateConnector(targetTopic); - - }, - - _positionateConnector:function (targetTopic) { - var targetPosition = targetTopic.getPosition(); - var offset = mindplot.Topic.CONNECTOR_WIDTH / 2; - var targetTopicSize = targetTopic.getSize(); - var y, x; - if (targetTopic.getShapeType() == mindplot.model.TopicShape.LINE) { - y = targetTopicSize.height; - } else { - y = targetTopicSize.height / 2; - } - y = y - offset; - - var connector = targetTopic.getShrinkConnector(); - if ($defined(connector)) { - if (Math.sign(targetPosition.x) > 0) { - x = targetTopicSize.width; - connector.setPosition(x, y); - } - else { - x = -mindplot.Topic.CONNECTOR_WIDTH; - } - connector.setPosition(x, y); - } - - }, - - setStroke:function (color, style, opacity) { - this._line2d.setStroke(null, null, color, opacity); - }, - - addToWorkspace:function (workspace) { - workspace.append(this._line2d); - this._line2d.moveToBack(); - }, - - removeFromWorkspace:function (workspace) { - workspace.removeChild(this._line2d); - }, - - getTargetTopic:function () { - return this._targetTopic; - }, - - getSourceTopic:function () { - return this._sourceTopic; - }, - - getLineType:function () { - return this._lineType; - }, - - getLine:function () { - return this._line2d; - }, - - getModel:function () { - return this._model; - }, - - setModel:function (model) { - this._model = model; - }, - - getType:function () { - return "ConnectionLine"; - }, - - getId:function () { - return this._model.getId(); - }, - - moveToBack:function () { - this._line2d.moveToBack(); - }, - - moveToFront:function () { - this._line2d.moveToFront(); - } -}); - -mindplot.ConnectionLine.getStrokeColor = function () { - return '#495879'; -}; - -mindplot.ConnectionLine.SIMPLE = 0; -mindplot.ConnectionLine.POLYLINE = 1; -mindplot.ConnectionLine.CURVED = 2; -mindplot.ConnectionLine.SIMPLE_CURVED = 3; \ No newline at end of file diff --git a/mindplot/src/main/javascript/ControlPoint.js b/mindplot/src/main/javascript/ControlPoint.js deleted file mode 100644 index c7bcb3ca..00000000 --- a/mindplot/src/main/javascript/ControlPoint.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ControlPoint = new Class({ - initialize: function () { - var control1 = new web2d.Elipse({ - width: 6, - height: 6, - stroke: '1 solid #6589de', - fillColor: 'gray', - visibility: false - }); - control1.setCursor('pointer'); - - var control2 = new web2d.Elipse({ - width: 6, - height: 6, - stroke: '1 solid #6589de', - fillColor: 'gray', - visibility: false - }); - control2.setCursor('pointer'); - - this._controlPointsController = [control1, control2]; - this._controlLines = [new web2d.Line({strokeColor: "#6589de", strokeWidth: 1, opacity: 0.3}), - new web2d.Line({strokeColor: "#6589de", strokeWidth: 1, opacity: 0.3})]; - - this._isBinded = false; - var me = this; - this._controlPointsController[0].addEvent('mousedown', function (event) { - (me._mouseDown)(event, mindplot.ControlPoint.FROM, me); - }); - this._controlPointsController[0].addEvent('click', function (event) { - (me._mouseClick)(event); - }); - this._controlPointsController[0].addEvent('dblclick', function (event) { - (me._mouseClick)(event); - }); - - this._controlPointsController[1].addEvent('mousedown', function (event) { - (me._mouseDown)(event, mindplot.ControlPoint.TO, me); - }); - this._controlPointsController[1].addEvent('click', function (event) { - (me._mouseClick)(event); - }); - this._controlPointsController[1].addEvent('dblclick', function (event) { - (me._mouseClick)(event); - }); - }, - - setLine: function (line) { - if ($defined(this._line)) { - this._removeLine(); - } - this._line = line; - this._createControlPoint(); - this._endPoint = []; - this._orignalCtrlPoint = []; - this._orignalCtrlPoint[0] = this._controls[0].clone(); - this._orignalCtrlPoint[1] = this._controls[1].clone(); - this._endPoint[0] = this._line.getLine().getFrom().clone(); - this._endPoint[1] = this._line.getLine().getTo().clone(); - }, - - redraw: function () { - if ($defined(this._line)) - this._createControlPoint(); - }, - - _createControlPoint: function () { - this._controls = this._line.getLine().getControlPoints(); - var pos = this._line.getLine().getFrom(); - this._controlPointsController[0].setPosition(this._controls[mindplot.ControlPoint.FROM].x + pos.x, this._controls[mindplot.ControlPoint.FROM].y + pos.y - 3); - this._controlLines[0].setFrom(pos.x, pos.y); - this._controlLines[0].setTo(this._controls[mindplot.ControlPoint.FROM].x + pos.x + 3, this._controls[mindplot.ControlPoint.FROM].y + pos.y); - pos = this._line.getLine().getTo(); - this._controlLines[1].setFrom(pos.x, pos.y); - this._controlLines[1].setTo(this._controls[mindplot.ControlPoint.TO].x + pos.x + 3, this._controls[mindplot.ControlPoint.TO].y + pos.y); - this._controlPointsController[1].setPosition(this._controls[mindplot.ControlPoint.TO].x + pos.x, this._controls[mindplot.ControlPoint.TO].y + pos.y - 3); - - }, - - _removeLine: function () { - - }, - - _mouseDown: function (event, point, me) { - if (!this._isBinded) { - this._isBinded = true; - this._mouseMoveFunction = function (event) { - (me._mouseMoveEvent)(event, point, me); - }; - - this._workspace.getScreenManager().addEvent('mousemove', this._mouseMoveFunction); - this._mouseUpFunction = function (event) { - (me._mouseUp)(event, point, me); - }; - this._workspace.getScreenManager().addEvent('mouseup', this._mouseUpFunction); - } - event.preventDefault(); - event.stopPropagation(); - return false; - }, - - _mouseMoveEvent: function (event, point) { - var screen = this._workspace.getScreenManager(); - var pos = screen.getWorkspaceMousePosition(event); - - var cords; - if (point == 0) { - cords = mindplot.util.Shape.calculateRelationShipPointCoordinates(this._line.getSourceTopic(), pos); - this._line.setFrom(cords.x, cords.y); - this._line.setSrcControlPoint(new core.Point(pos.x - cords.x, pos.y - cords.y)); - } else { - cords = mindplot.util.Shape.calculateRelationShipPointCoordinates(this._line.getTargetTopic(), pos); - this._line.setTo(cords.x, cords.y); - this._line.setDestControlPoint(new core.Point(pos.x - cords.x, pos.y - cords.y)); - } - - this._controls[point].x = (pos.x - cords.x); - this._controls[point].y = (pos.y - cords.y); - this._controlPointsController[point].setPosition(pos.x - 5, pos.y - 3); - this._controlLines[point].setFrom(cords.x, cords.y); - this._controlLines[point].setTo(pos.x - 2, pos.y); - this._line.getLine().updateLine(point); - - }, - - _mouseUp: function (event, point) { - this._workspace.getScreenManager().removeEvent('mousemove', this._mouseMoveFunction); - this._workspace.getScreenManager().removeEvent('mouseup', this._mouseUpFunction); - - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.moveControlPoint(this, point); - this._isBinded = false; - }, - - _mouseClick: function (event) { - event.preventDefault(); - event.stopPropagation(); - return false; - }, - - setVisibility: function (visible) { - if (visible) { - this._controlLines[0].moveToFront(); - this._controlLines[1].moveToFront(); - this._controlPointsController[0].moveToFront(); - this._controlPointsController[1].moveToFront(); - } - this._controlPointsController[0].setVisibility(visible); - this._controlPointsController[1].setVisibility(visible); - this._controlLines[0].setVisibility(visible); - this._controlLines[1].setVisibility(visible); - }, - - addToWorkspace: function (workspace) { - this._workspace = workspace; - workspace.append(this._controlPointsController[0]); - workspace.append(this._controlPointsController[1]); - workspace.append(this._controlLines[0]); - workspace.append(this._controlLines[1]); - }, - - removeFromWorkspace: function (workspace) { - this._workspace = null; - workspace.removeChild(this._controlPointsController[0]); - workspace.removeChild(this._controlPointsController[1]); - workspace.removeChild(this._controlLines[0]); - workspace.removeChild(this._controlLines[1]); - }, - - getControlPoint: function (index) { - return this._controls[index]; - }, - - getOriginalEndPoint: function (index) { - return this._endPoint[index]; - }, - - getOriginalCtrlPoint: function (index) { - return this._orignalCtrlPoint[index]; - } -}); - -mindplot.ControlPoint.FROM = 0; -mindplot.ControlPoint.TO = 1; diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js deleted file mode 100644 index ea9b2e14..00000000 --- a/mindplot/src/main/javascript/Designer.js +++ /dev/null @@ -1,1027 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Designer = new Class(/** @lends Designer */{ - Extends: mindplot.Events, - /** - * @constructs - * @param {Object} options - * @param {HTMLElement} divElement - * @extends mindplot.Events - */ - initialize: function (options, divElement) { - $assert(options, "options must be defined"); - $assert(options.zoom, "zoom must be defined"); - $assert(options.size, "size must be defined"); - $assert(divElement, "divElement must be defined"); - - // Set up i18n location ... - mindplot.Messages.init(options.locale); - - this._options = options; - - // Set full div elem render area ... - divElement.css(options.size); - - // Dispatcher manager ... - var commandContext = new mindplot.CommandContext(this); - this._actionDispatcher = new mindplot.StandaloneActionDispatcher(commandContext); - - var me = this; - this._actionDispatcher.addEvent("modelUpdate", function (event) { - me.fireEvent("modelUpdate", event); - }); - - mindplot.ActionDispatcher.setInstance(this._actionDispatcher); - this._model = new mindplot.DesignerModel(options); - - // Init Screen manager.. - var screenManager = new mindplot.ScreenManager(divElement); - this._workspace = new mindplot.Workspace(screenManager, this._model.getZoom()); - - // Init layout manager ... - this._eventBussDispatcher = new mindplot.layout.EventBusDispatcher(this.getModel()); - - // Register events - if (!this.isReadOnly()) { - // Register mouse events ... - this._registerMouseEvents(); - - // Register keyboard events ... - mindplot.DesignerKeyboard.register(this); - - this._dragManager = this._buildDragManager(this._workspace); - } - this._registerWheelEvents(); - - this._relPivot = new mindplot.RelationshipPivot(this._workspace, this); - - // Set editor working area ... - this.setViewPort(options.viewPort); - - mindplot.TopicEventDispatcher.configure(this.isReadOnly()); - this._clipboard = []; - }, - - /** - * @private - */ - _registerWheelEvents: function () { - var zoomFactor = 1.006; - var me = this; - // Zoom In and Zoom Out must active event - $(document).on('mousewheel', function (event) { - if (event.deltaY > 0) { - me.zoomIn(zoomFactor); - } else { - me.zoomOut(zoomFactor); - } - event.preventDefault(); - }); - }, - - /** - * @param {String} type the event type - * @param {Function} listener - * forwards to the TopicEventDispatcher or the parent Events class, depending on the type - */ - addEvent: function (type, listener) { - if (type == mindplot.TopicEvent.EDIT || type == mindplot.TopicEvent.CLICK) { - var editor = mindplot.TopicEventDispatcher.getInstance(); - editor.addEvent(type, listener); - } else { - this.parent(type, listener); - } - }, - - /** - * @private - */ - _registerMouseEvents: function () { - var workspace = this._workspace; - var screenManager = workspace.getScreenManager(); - var me = this; - // Initialize workspace event listeners. - screenManager.addEvent('update', function () { - // Topic must be set to his original state. All editors must be closed. - var topics = me.getModel().getTopics(); - _.each(topics, function (object) { - object.closeEditors(); - }); - - // Clean some selected nodes on event .. - if (me._cleanScreen) - me._cleanScreen(); - }); - - // Deselect on click ... - screenManager.addEvent('click', function (event) { - me.onObjectFocusEvent(null, event); - }); - - // Create nodes on double click... - screenManager.addEvent('dblclick', function (event) { - if (workspace.isWorkspaceEventsEnabled()) { - var mousePos = screenManager.getWorkspaceMousePosition(event); - var centralTopic = me.getModel().getCentralTopic(); - var model = me._createChildModel(centralTopic, mousePos); - this._actionDispatcher.addTopics([model], [centralTopic.getId()]); - } - }.bind(this)); - - // Register mouse drag and drop event ... - function noopHandler(evt) { - evt.stopPropagation(); - evt.preventDefault(); - } - }, - - /** - * @private - * @param {mindplot.Workspace} workspace - * @return {mindplot.DragManager} the new dragManager for the workspace with events - * registered - */ - _buildDragManager: function (workspace) { - - var designerModel = this.getModel(); - var dragConnector = new mindplot.DragConnector(designerModel, this._workspace); - var dragManager = new mindplot.DragManager(workspace, this._eventBussDispatcher); - var topics = designerModel.getTopics(); - - dragManager.addEvent('startdragging', function () { - // Enable all mouse events. - for (var i = 0; i < topics.length; i++) { - topics[i].setMouseEventsEnabled(false); - } - }); - - dragManager.addEvent('dragging', function (event, dragTopic) { - dragTopic.updateFreeLayout(event); - if (!dragTopic.isFreeLayoutOn(event)) { - // The node is being drag. Is the connection still valid ? - dragConnector.checkConnection(dragTopic); - - if (!dragTopic.isVisible() && dragTopic.isConnected()) { - dragTopic.setVisibility(true); - } - } - }); - - dragManager.addEvent('enddragging', function (event, dragTopic) { - for (var i = 0; i < topics.length; i++) { - topics[i].setMouseEventsEnabled(true); - } - dragTopic.applyChanges(workspace); - }); - - return dragManager; - }, - - /** - * @param {{width:Number, height:Number}} size - * sets width and height of the workspace - */ - setViewPort: function (size) { - this._workspace.setViewPort(size); - var model = this.getModel(); - this._workspace.setZoom(model.getZoom(), true); - }, - - /** - * @private - * @param {mindplot.model.NodeModel} model - * @param {Boolean} readOnly - * @return {mindplot.CentralTopic|mindplot.MainTopic} the topic to the given model, - * connected, added to the drag manager, with events registered - complying type & read mode - */ - _buildNodeGraph: function (model, readOnly) { - - // Create node graph ... - var topic = mindplot.NodeGraph.create(model, {readOnly: readOnly}); - this.getModel().addTopic(topic); - var me = this; - // Add Topic events ... - if (!readOnly) { - // If a node had gained focus, clean the rest of the nodes ... - topic.addEvent('mousedown', function (event) { - me.onObjectFocusEvent(topic, event); - }); - - // Register node listeners ... - if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - - // Central Topic doesn't support to be dragged - this._dragManager.add(topic); - } - } - - // Connect Topic ... - var isConnected = model.isConnected(); - if (isConnected) { - // Improve this ... - var targetTopicModel = model.getParent(); - var targetTopic = null; - - var topics = this.getModel().getTopics(); - for (var i = 0; i < topics.length; i++) { - var t = topics[i]; - if (t.getModel() == targetTopicModel) { - targetTopic = t; - // Disconnect the node. It will be connected again later ... - model.disconnect(); - break; - } - } - $assert(targetTopic, "Could not find a topic to connect"); - topic.connectTo(targetTopic, this._workspace); - } - - topic.addEvent('ontblur', function () { - var topics = me.getModel().filterSelectedTopics(); - var rels = me.getModel().filterSelectedRelationships(); - - if (topics.length == 0 || rels.length == 0) { - me.fireEvent('onblur'); - } - }); - - topic.addEvent('ontfocus', function () { - var topics = me.getModel().filterSelectedTopics(); - var rels = me.getModel().filterSelectedRelationships(); - - if (topics.length == 1 || rels.length == 1) { - me.fireEvent('onfocus'); - } - }); - - return topic; - }, - - /** - * @param {?mindplot.Topic} currentObject - * @param {Event=} event - * sets focus to the given currentObject and removes it from any other objects if not - * triggered with Ctrl pressed - */ - onObjectFocusEvent: function (currentObject, event) { - // Close node editors .. - var topics = this.getModel().getTopics(); - _.each(topics, function (topic) { - topic.closeEditors(); - }); - - var model = this.getModel(); - var objects = model.getEntities(); - _.each(objects, function (object) { - // Disable all nodes on focus but not the current if Ctrl key isn't being pressed - if (!$defined(event) || (!event.ctrlKey && !event.metaKey)) { - if (object.isOnFocus() && object != currentObject) { - object.setOnFocus(false); - } - } - }); - - }, - - /** sets focus to all model entities, i.e. relationships and topics */ - selectAll: function () { - var model = this.getModel(); - var objects = model.getEntities(); - _.each(objects, function (object) { - object.setOnFocus(true); - }); - }, - - /** removes focus from all model entities, i.e. relationships and topics */ - deselectAll: function () { - var objects = this.getModel().getEntities(); - _.each(objects, function (object) { - object.setOnFocus(false); - }); - }, - - /** - * Set the zoom of the map - * @param {Number} zoom number between 0.3 and 1.9 - */ - setZoom: function (zoom) { - if (zoom > 1.9 || zoom < 0.3) { - $notify($msg('ZOOM_IN_ERROR')); - return; - } - this.getModel().setZoom(zoom); - this._workspace.setZoom(zoom); - }, - - /** - * @param {Number=} factor - * zoom out by the given factor, or 1.2, if undefined - */ - zoomOut: function (factor) { - if (!factor) - factor = 1.2; - - var model = this.getModel(); - var scale = model.getZoom() * factor; - if (scale <= 1.9) { - model.setZoom(scale); - this._workspace.setZoom(scale); - } - else { - $notify($msg('ZOOM_ERROR')); - } - - }, - - /** - * @param {Number=} factor - * zoom in by the given factor, or 1.2, if undefined - */ - zoomIn: function (factor) { - if (!factor) - factor = 1.2; - - var model = this.getModel(); - var scale = model.getZoom() / factor; - - if (scale >= 0.3) { - model.setZoom(scale); - this._workspace.setZoom(scale); - } - else { - $notify($msg('ZOOM_ERROR')); - } - }, - - /** copy selected topics to a private clipboard */ - copyToClipboard: function () { - var topics = this.getModel().filterSelectedTopics(); - if (topics.length <= 0) { - // If there are more than one node selected, - $notify($msg('AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED')); - return; - } - - // Exclude central topic .. - topics = topics.filter(function (topic) { - return !topic.isCentralTopic(); - }); - - this._clipboard = topics.map(function (topic) { - var nodeModel = topic.getModel().deepCopy(); - - // Change position to make the new topic evident... - var pos = nodeModel.getPosition(); - nodeModel.setPosition(pos.x + (60 * Math.sign(pos.x)), pos.y + 30); - - return nodeModel; - }); - - $notify($msg('SELECTION_COPIED_TO_CLIPBOARD')); - }, - - /** paste clipboard contents to the mindmap */ - pasteClipboard: function () { - if (this._clipboard.length == 0) { - $notify($msg('CLIPBOARD_IS_EMPTY')); - return; - } - this._actionDispatcher.addTopics(this._clipboard); - this._clipboard = []; - }, - - /** @return {mindplot.DesignerModel} model */ - getModel: function () { - return this._model; - }, - - /** collapse the subtree of the selected topic */ - shrinkSelectedBranch: function () { - var nodes = this.getModel().filterSelectedTopics(); - if (nodes.length <= 0 || nodes.length != 1) { - // If there are more than one node selected, - $notify($msg('ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE')); - return; - - } - // Execute event ... - var topic = nodes[0]; - if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken()); - } - }, - - /** create a NodeModel for the selected node's child and add it via the ActionDispatcher */ - createChildForSelectedNode: function () { - var nodes = this.getModel().filterSelectedTopics(); - if (nodes.length <= 0) { - // If there are more than one node selected, - $notify($msg('ONE_TOPIC_MUST_BE_SELECTED')); - return; - - } - if (nodes.length != 1) { - - // If there are more than one node selected, - $notify($msg('ONLY_ONE_TOPIC_MUST_BE_SELECTED')); - return; - } - - // Add new node ... - var parentTopic = nodes[0]; - var parentTopicId = parentTopic.getId(); - var childModel = this._createChildModel(parentTopic); - - // Execute event ... - this._actionDispatcher.addTopics([childModel], [parentTopicId]); - - }, - - /** - * @private - */ - _copyNodeProps: function (sourceModel, targetModel) { - - // I don't copy the font size if the target is the source is the central topic. - if (sourceModel.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - var fontSize = sourceModel.getFontSize(); - if (fontSize) { - targetModel.setFontSize(fontSize) - } - } - - var fontFamily = sourceModel.getFontFamily(); - if (fontFamily) { - targetModel.setFontFamily(fontFamily) - } - - var fontColor = sourceModel.getFontColor(); - if (fontColor) { - targetModel.setFontColor(fontColor) - } - - var fontWeight = sourceModel.getFontWeight(); - if (fontWeight) { - targetModel.setFontWeight(fontWeight) - } - - var fontStyle = sourceModel.getFontStyle(); - if (fontStyle) { - targetModel.setFontStyle(fontStyle) - } - - var shape = sourceModel.getShapeType(); - if (shape) { - targetModel.setShapeType(shape) - } - - var borderColor = sourceModel.getBorderColor(); - if (borderColor) { - targetModel.setBorderColor(borderColor) - } - - var backgroundColor = sourceModel.getBackgroundColor(); - if (backgroundColor) { - targetModel.setBackgroundColor(backgroundColor) - } - }, - - /** - * @private - * @param {mindplot.Topic} topic the parent topic of the child to create the NodeModel for - * @param {core.Point} mousePos the mouse position - * @return {mindplot.NodeModel} the node model for the new child - */ - _createChildModel: function (topic, mousePos) { - // Create a new node ... - var parentModel = topic.getModel(); - var mindmap = parentModel.getMindmap(); - var childModel = mindmap.createNode(); - - // Create a new node ... - var layoutManager = this._eventBussDispatcher.getLayoutManager(); - var result = layoutManager.predict(topic.getId(), null, mousePos); - childModel.setOrder(result.order); - - var position = result.position; - childModel.setPosition(position.x, position.y); - - this._copyNodeProps(parentModel, childModel); - - return childModel; - }, - - /** - * @param {Events} event - * @param {mindplot.model.NodeModel} model - * @todo not used - */ - addDraggedNode: function (event, model) { - $assert(event, "event can not be null"); - $assert(model, "model can not be null"); - - // Position far from the visual area ... - model.setPosition(1000, 1000); - - this._actionDispatcher.addTopics([model]); - var topic = this.getModel().findTopicById(model.getId()); - - // Simulate a mouse down event to start the dragging ... - topic.fireEvent("mousedown", event); - }, - - /** - * creates a sibling or child node of the selected node, if the selected node is the - * central topic - */ - createSiblingForSelectedNode: function () { - var nodes = this.getModel().filterSelectedTopics(); - if (nodes.length <= 0) { - // If there are no nodes selected, - $notify($msg('ONE_TOPIC_MUST_BE_SELECTED')); - return; - - } - if (nodes.length > 1) { - // If there are more than one node selected, - $notify($msg('ONLY_ONE_TOPIC_MUST_BE_SELECTED')); - return; - } - - var topic = nodes[0]; - if (!topic.getOutgoingConnectedTopic()) { // Central topic and isolated topics .... - // Central topic doesn't have siblings ... - this.createChildForSelectedNode(); - - } else { - var parentTopic = topic.getOutgoingConnectedTopic(); - var siblingModel = this._createSiblingModel(topic); - - // Hack: if parent is central topic, add node below not on opposite side. - // This should be done in the layout - if (parentTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - siblingModel.setOrder(topic.getOrder() + 2); - } - - var parentTopicId = parentTopic.getId(); - this._actionDispatcher.addTopics([siblingModel], [parentTopicId]); - } - }, - - /** - * @private - * @param {mindplot.Topic} topic the topic to create the sibling to - * @return {mindplot.NodeModel} the node model of the sibling - */ - _createSiblingModel: function (topic) { - var result = null; - var parentTopic = topic.getOutgoingConnectedTopic(); - if (parentTopic != null) { - - // Create a new node ... - var model = topic.getModel(); - var mindmap = model.getMindmap(); - result = mindmap.createNode(); - - // Create a new node ... - var order = topic.getOrder() + 1; - result.setOrder(order); - result.setPosition(10, 10); // Set a dummy position ... - } - - this._copyNodeProps(model, result); - - return result; - }, - - /** - * @param {Event} event - */ - showRelPivot: function (event) { - - var nodes = this.getModel().filterSelectedTopics(); - if (nodes.length <= 0) { - // This could not happen ... - $notify($msg('RELATIONSHIP_COULD_NOT_BE_CREATED')); - return; - } - - // Current mouse position .... - var screen = this._workspace.getScreenManager(); - var pos = screen.getWorkspaceMousePosition(event); - - // create a connection ... - this._relPivot.start(nodes[0], pos); - }, - - /** @return {{zoom:Number}} the zoom */ - getMindmapProperties: function () { - var model = this.getModel(); - return {zoom: model.getZoom()}; - }, - - /** - * @param {mindplot.Mindmap} mindmapModel - * @throws will throw an error if mindmapModel is null or undefined - */ - loadMap: function (mindmapModel) { - $assert(mindmapModel, "mindmapModel can not be null"); - this._mindmap = mindmapModel; - - // Init layout manager ... - var size = {width: 25, height: 25}; - var layoutManager = new mindplot.layout.LayoutManager(mindmapModel.getCentralTopic().getId(), size); - var me = this; - layoutManager.addEvent('change', function (event) { - var id = event.getId(); - var topic = me.getModel().findTopicById(id); - topic.setPosition(event.getPosition()); - topic.setOrder(event.getOrder()); - }); - this._eventBussDispatcher.setLayoutManager(layoutManager); - - - // Building node graph ... - var branches = mindmapModel.getBranches(); - for (var i = 0; i < branches.length; i++) { - // NodeModel -> NodeGraph ... - var nodeModel = branches[i]; - var nodeGraph = this.nodeModelToNodeGraph(nodeModel); - - // Update shrink render state... - nodeGraph.setBranchVisibility(true); - } - - var relationships = mindmapModel.getRelationships(); - for (var j = 0; j < relationships.length; j++) { - this._relationshipModelToRelationship(relationships[j]); - } - - // Place the focus on the Central Topic - var centralTopic = this.getModel().getCentralTopic(); - this.goToNode(centralTopic); - - // Finally, sort the map ... - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - - this.fireEvent('loadSuccess'); - }, - - /** */ - getMindmap: function () { - return this._mindmap; - }, - - /** */ - undo: function () { - // @Todo: This is a hack... - this._actionDispatcher._actionRunner.undo(); - }, - - /** */ - redo: function () { - this._actionDispatcher._actionRunner.redo(); - }, - - /** */ - isReadOnly: function () { - return this._options.readOnly; - }, - - /** - * @param {mindplot.model.NodeModel} nodeModel - * @return {mindplot.Topic} the topic (extends mindplot.NodeGraph) created to the model - */ - nodeModelToNodeGraph: function (nodeModel) { - $assert(nodeModel, "Node model can not be null"); - var children = nodeModel.getChildren().slice(); - children = children.sort(function (a, b) { - return a.getOrder() - b.getOrder() - }); - - var nodeGraph = this._buildNodeGraph(nodeModel, this.isReadOnly()); - nodeGraph.setVisibility(false); - - this._workspace.append(nodeGraph); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if ($defined(child)) - this.nodeModelToNodeGraph(child); - } - - return nodeGraph; - }, - - /** - * @private - * @param {mindplot.model.RelationshipModel} model - * @return {mindplot.Relationship} the relationship created to the model - * @throws will throw an error if model is null or undefined - */ - _relationshipModelToRelationship: function (model) { - $assert(model, "Node model can not be null"); - - var result = this._buildRelationshipShape(model); - - var sourceTopic = result.getSourceTopic(); - sourceTopic.addRelationship(result); - - var targetTopic = result.getTargetTopic(); - targetTopic.addRelationship(result); - - result.setVisibility(sourceTopic.isVisible() && targetTopic.isVisible()); - - this._workspace.append(result); - return result; - }, - - /** - * @param {mindplot.model.RelationshipModel} model - * @return {mindplot.Relationship} the relationship added to the mindmap - */ - addRelationship: function (model) { - var mindmap = this.getMindmap(); - mindmap.addRelationship(model); - return this._relationshipModelToRelationship(model); - }, - - /** - * deletes the relationship from the linked topics, DesignerModel, Workspace and Mindmap - * @param {mindplot.Relationship} rel the relationship to delete - */ - deleteRelationship: function (rel) { - var sourceTopic = rel.getSourceTopic(); - sourceTopic.deleteRelationship(rel); - - var targetTopic = rel.getTargetTopic(); - targetTopic.deleteRelationship(rel); - - this.getModel().removeRelationship(rel); - this._workspace.removeChild(rel); - - var mindmap = this.getMindmap(); - mindmap.deleteRelationship(rel.getModel()); - }, - - /** - * @private - * @param {mindplot.model.RelationshipModel} model - * @return {mindplot.Relationship} the new relationship with events registered - * @throws will throw an error if the target topic cannot be found - */ - _buildRelationshipShape: function (model) { - var dmodel = this.getModel(); - - var sourceTopicId = model.getFromNode(); - var sourceTopic = dmodel.findTopicById(sourceTopicId); - - var targetTopicId = model.getToNode(); - var targetTopic = dmodel.findTopicById(targetTopicId); - $assert(targetTopic, "targetTopic could not be found:" + targetTopicId + dmodel.getTopics().map(function (e) { - return e.getId() - })); - - // Build relationship line .... - var result = new mindplot.Relationship(sourceTopic, targetTopic, model); - var me = this; - - result.addEvent('ontblur', function () { - var topics = me.getModel().filterSelectedTopics(); - var rels = me.getModel().filterSelectedRelationships(); - - if (topics.length == 0 || rels.length == 0) { - me.fireEvent('onblur'); - } - }); - - result.addEvent('ontfocus', function () { - var topics = me.getModel().filterSelectedTopics(); - var rels = me.getModel().filterSelectedRelationships(); - - if (topics.length == 1 || rels.length == 1) { - me.fireEvent('onfocus'); - } - }); - - // Append it to the workspace ... - dmodel.addRelationship(result); - - return result; - }, - - /** - * @param {mindplot.Topic} node the topic to remove - * removes the given topic and its children from Workspace, DesignerModel and NodeModel - */ - removeTopic: function (node) { - if (!node.isCentralTopic()) { - var parent = node._parent; - node.disconnect(this._workspace); - - //remove children - while (node.getChildren().length > 0) { - this.removeTopic(node.getChildren()[0]); - } - - this._workspace.removeChild(node); - this.getModel().removeTopic(node); - - // Delete this node from the model... - var model = node.getModel(); - model.deleteNode(); - - if ($defined(parent)) { - this.goToNode(parent); - } - } - }, - - /** - * @private - */ - _resetEdition: function () { - var screenManager = this._workspace.getScreenManager(); - screenManager.fireEvent("update"); - screenManager.fireEvent("mouseup"); - this._relPivot.dispose(); - }, - - /** */ - deleteSelectedEntities: function () { - // Is there some action in progress ?. - this._resetEdition(); - - var topics = this.getModel().filterSelectedTopics(); - var relation = this.getModel().filterSelectedRelationships(); - if (topics.length <= 0 && relation.length <= 0) { - // If there are more than one node selected, - $notify($msg('ENTITIES_COULD_NOT_BE_DELETED')); - return; - } else if (topics.length == 1 && topics[0].isCentralTopic()) { - $notify($msg('CENTRAL_TOPIC_CAN_NOT_BE_DELETED')); - return; - } - - // If the central topic has been selected, I must filter ir - var topicIds = topics.filter(function (topic) { - return !topic.isCentralTopic(); - }).map(function (topic) { - return topic.getId() - }); - - - var relIds = relation.map(function (rel) { - return rel.getId(); - }); - - // Finally delete the topics ... - if (topicIds.length > 0 || relIds.length > 0) { - this._actionDispatcher.deleteEntities(topicIds, relIds); - } - - }, - - /** */ - changeFontFamily: function (font) { - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.changeFontFamilyToTopic(topicsIds, font); - - } - }, - - /** */ - changeFontStyle: function () { - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.changeFontStyleToTopic(topicsIds); - } - }, - - /** */ - changeFontColor: function (color) { - $assert(color, "color can not be null"); - - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.changeFontColorToTopic(topicsIds, color); - } - }, - - /** */ - changeBackgroundColor: function (color) { - - var validateFunc = function (topic) { - return topic.getShapeType() != mindplot.model.TopicShape.LINE; - }; - var validateError = 'Color can not be set to line topics.'; - - var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); - if (topicsIds.length > 0) { - this._actionDispatcher.changeBackgroundColorToTopic(topicsIds, color); - } - }, - - /** */ - changeBorderColor: function (color) { - var validateFunc = function (topic) { - return topic.getShapeType() != mindplot.model.TopicShape.LINE; - }; - var validateError = 'Color can not be set to line topics.'; - var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); - if (topicsIds.length > 0) { - this._actionDispatcher.changeBorderColorToTopic(topicsIds, color); - } - }, - - /** */ - changeFontSize: function (size) { - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.changeFontSizeToTopic(topicsIds, size); - } - }, - - /** */ - changeTopicShape: function (shape) { - var validateFunc = function (topic) { - return !(topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.TopicShape.LINE) - }; - - var validateError = 'Central Topic shape can not be changed to line figure.'; - var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); - if (topicsIds.length > 0) { - this._actionDispatcher.changeShapeTypeToTopic(topicsIds, shape); - } - }, - - /** */ - changeFontWeight: function () { - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.changeFontWeightToTopic(topicsIds); - } - }, - - /** */ - addIconType: function (iconType) { - var topicsIds = this.getModel().filterTopicsIds(); - if (topicsIds.length > 0) { - this._actionDispatcher.addFeatureToTopic(topicsIds[0], mindplot.TopicFeature.Icon.id, {id: iconType}); - } - }, - - /** - * lets the selected topic open the link editor where the user can define or modify an - * existing link - */ - addLink: function () { - var model = this.getModel(); - var topic = model.selectedTopic(); - if (topic) { - topic.showLinkEditor(); - this.onObjectFocusEvent(); - } - }, - - /** */ - addNote: function () { - var model = this.getModel(); - var topic = model.selectedTopic(); - if (topic) { - topic.showNoteEditor(); - this.onObjectFocusEvent(); - } - }, - - /** - * @param {mindplot.Topic} node - * sets the focus to the given node - */ - goToNode: function (node) { - node.setOnFocus(true); - this.onObjectFocusEvent(node); - }, - - /** @return {mindplot.Workspace} */ - getWorkSpace: function () { - return this._workspace; - } - } -); diff --git a/mindplot/src/main/javascript/DesignerActionRunner.js b/mindplot/src/main/javascript/DesignerActionRunner.js deleted file mode 100644 index b7e7304d..00000000 --- a/mindplot/src/main/javascript/DesignerActionRunner.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DesignerActionRunner = new Class({ - initialize: function (commandContext, notifier) { - $assert(commandContext, "commandContext can not be null"); - - this._undoManager = new mindplot.DesignerUndoManager(); - this._context = commandContext; - this._notifier = notifier; - }, - - execute: function (command) { - $assert(command, "command can not be null"); - command.execute(this._context); - this._undoManager.enqueue(command); - this.fireChangeEvent(); - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - - }, - - undo: function () { - this._undoManager.execUndo(this._context); - this.fireChangeEvent(); - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - }, - - redo: function () { - this._undoManager.execRedo(this._context); - this.fireChangeEvent(); - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.DoLayout); - - }, - - fireChangeEvent: function () { - var event = this._undoManager.buildEvent(); - this._notifier.fireEvent("modelUpdate", event); - } -}); diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js deleted file mode 100644 index 48b8377c..00000000 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ /dev/null @@ -1,397 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DesignerKeyboard = new Class({ - Extends: mindplot.Keyboard, - Static:{ - register:function (designer) { - this._instance = new mindplot.DesignerKeyboard(designer); - }, - - getInstance:function () { - return this._instance; - } - }, - - initialize:function (designer) { - $assert(designer, "designer can not be null"); - this._registerEvents(designer); - }, - - _registerEvents:function (designer) { - - // Try with the keyboard .. - var model = designer.getModel(); - this.addShortcut( - ['backspace'], function (event) { - event.preventDefault(); - event.stopPropagation(); - designer.deleteSelectedEntities(); - } - ); - this.addShortcut( - ['space'], function() { - designer.shrinkSelectedBranch(); - } - ); - this.addShortcut( - ['f2'],function(event) { - event.stopPropagation(); - event.preventDefault(); - var node = model.selectedTopic(); - if (node) { - node.showTextEditor(); - } - } - ); - this.addShortcut( - ['del'], function(event) { - designer.deleteSelectedEntities(); - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - ['enter'], function() { - designer.createSiblingForSelectedNode(); - } - ); - this.addShortcut( - ['insert'], function(event) { - designer.createChildForSelectedNode(); - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - ['tab'], function(event) { - designer.createChildForSelectedNode(); - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - ['meta+enter'], function(event) { - event.preventDefault(); - event.stopPropagation(); - designer.createChildForSelectedNode(); - } - ); - this.addShortcut( - ['ctrl+z', 'meta+z'], function(event) { - event.preventDefault(event); - event.stopPropagation(); - designer.undo(); - } - ); - this.addShortcut( - ['ctrl+c', 'meta+c'], function (event) { - event.preventDefault(event); - event.stopPropagation(); - designer.copyToClipboard(); - } - ); - this.addShortcut( - ['ctrl+v', 'meta+v'], function (event) { - event.preventDefault(event); - event.stopPropagation(); - designer.pasteClipboard(); - } - ); - this.addShortcut( - ['ctrl+shift+z', 'meta+shift+z', 'ctrl+y', 'meta+y'], function (event) { - event.preventDefault(); - event.stopPropagation(); - designer.redo(); - } - ); - this.addShortcut( - ['ctrl+a', 'meta+a'], function (event) { - event.preventDefault(); - event.stopPropagation(); - designer.selectAll(); - } - ); - this.addShortcut( - ['ctrl+b', 'meta+b'], function (event) { - event.preventDefault(); - event.stopPropagation(); - - designer.changeFontWeight(); - } - ); - this.addShortcut( - ['ctrl+s', 'meta+s'], function (event) { - event.preventDefault(); - event.stopPropagation(); - $(document).find('#save').trigger('click'); - } - ); - this.addShortcut( - ['ctrl+i', 'meta+i'], function (event) { - event.preventDefault(); - event.stopPropagation(); - - designer.changeFontStyle(); - } - ); - this.addShortcut( - ['ctrl+shift+a', 'meta+shift+a'], function (event) { - event.preventDefault(); - event.stopPropagation(); - - designer.deselectAll(); - } - ); - this.addShortcut( - ['meta+=', 'ctrl+='], function (event) { - event.preventDefault(); - event.stopPropagation(); - - designer.zoomIn(); - } - ); - this.addShortcut( - ['meta+-', 'ctrl+-'], function (event) { - event.preventDefault(); - event.stopPropagation(); - - designer.zoomOut(); - } - ); - var me = this; - this.addShortcut( - 'right', function (event) { - var node = model.selectedTopic(); - if (node) { - if (node.isCentralTopic()) { - me._goToSideChild(designer, node, 'RIGHT'); - } - else { - if (node.getPosition().x < 0) { - me._goToParent(designer, node); - } - else if (!node.areChildrenShrunken()) { - me._goToChild(designer, node); - } - } - } else { - var centralTopic = model.getCentralTopic(); - me._goToNode(designer, centralTopic); - } - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - 'left', function (event) { - var node = model.selectedTopic(); - if (node) { - if (node.isCentralTopic()) { - me._goToSideChild(designer, node, 'LEFT'); - } - else { - if (node.getPosition().x > 0) { - me._goToParent(designer, node); - } - else if (!node.areChildrenShrunken()) { - me._goToChild(designer, node); - } - } - } else { - var centralTopic = model.getCentralTopic(); - me._goToNode(designer, centralTopic); - } - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - 'up', function (event) { - var node = model.selectedTopic(); - if (node) { - if (!node.isCentralTopic()) { - me._goToBrother(designer, node, 'UP'); - } - } else { - var centralTopic = model.getCentralTopic(); - me._goToNode(designer, centralTopic); - } - event.preventDefault(); - event.stopPropagation(); - } - ); - this.addShortcut( - 'down', function (event) { - var node = model.selectedTopic(); - if (node) { - if (!node.isCentralTopic()) { - me._goToBrother(designer, node, 'DOWN'); - } - } else { - var centralTopic = model.getCentralTopic(); - me._goToNode(designer, centralTopic); - } - event.preventDefault(); - event.stopPropagation(); - } - ); - var excludes = ['esc', 'escape', 'f1', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12']; - - $(document).on('keypress', function (event) { - var keyCode; - // Firefox doesn't skip special keys for keypress event... - if (event.key && excludes.contains(event.key.toLowerCase())) { - return; - } - // Sometimes Firefox doesn't contain keyCode value - if (event.key && event.keyCode == 0) { - keyCode = event.charCode; - } else { - keyCode = event.keyCode; - } - - var specialKey = jQuery.hotkeys.specialKeys[keyCode]; - if (["enter", "capslock"].indexOf(specialKey) == -1 && !jQuery.hotkeys.shiftNums[keyCode]) { - var nodes = designer.getModel().filterSelectedTopics(); - if (nodes.length > 0) { - - // If a modifier is press, the key selected must be ignored. - var pressKey = String.fromCharCode(keyCode); - if (event.ctrlKey || event.altKey || event.metaKey) { - return; - } - nodes[0].showTextEditor(pressKey); - event.stopPropagation(); - } - } - - }); - - }, - - _goToBrother:function (designer, node, direction) { - var parent = node.getParent(); - if (parent) { - var brothers = parent.getChildren(); - - var target = node; - var y = node.getPosition().y; - var x = node.getPosition().x; - var dist = null; - for (var i = 0; i < brothers.length; i++) { - var sameSide = (x * brothers[i].getPosition().x) >= 0; - if (brothers[i] != node && sameSide) { - var brother = brothers[i]; - var brotherY = brother.getPosition().y; - if (direction == "DOWN" && brotherY > y) { - var distancia = y - brotherY; - if (distancia < 0) { - distancia = distancia * (-1); - } - if (dist == null || dist > distancia) { - dist = distancia; - target = brothers[i]; - } - } - else if (direction == "UP" && brotherY < y) { - var distance = y - brotherY; - if (distance < 0) { - distance = distance * (-1); - } - if (dist == null || dist > distance) { - dist = distance; - target = brothers[i]; - } - } - } - } - this._goToNode(designer, target); - } - }, - - - _goToSideChild:function (designer, node, side) { - var children = node.getChildren(); - if (children.length > 0) { - var target = children[0]; - var top = null; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - var childY = child.getPosition().y; - if (side == 'LEFT' && child.getPosition().x < 0) { - if (top == null || childY < top) { - target = child; - top = childY; - } - } - if (side == 'RIGHT' && child.getPosition().x > 0) { - if (top == null || childY < top) { - target = child; - top = childY; - } - } - } - - this._goToNode(designer, target); - } - }, - - _goToParent:function (designer, node) { - var parent = node.getParent(); - if (parent) { - this._goToNode(designer, parent); - } - }, - - _goToChild:function (designer, node) { - var children = node.getChildren(); - if (children.length > 0) { - var target = children[0]; - var top = target.getPosition().y; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (child.getPosition().y < top) { - top = child.getPosition().y; - target = child; - } - } - this._goToNode(designer, target); - } - }, - - _goToNode:function (designer, node) { - // First deselect all the nodes ... - designer.deselectAll(); - - // Give focus to the selected node.... - node.setOnFocus(true); - } - -}); - -mindplot.DesignerKeyboard.specialKeys = { - 8: "backspace", 9: "tab", 10: "return", 13: "enter", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause", - 20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home", - 37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del", - 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", - 104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111 : "/", - 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", - 120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll", 186: ";", 191: "/", - 220: "\\", 222: "'", 224: "meta" -}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/DesignerModel.js b/mindplot/src/main/javascript/DesignerModel.js deleted file mode 100644 index 6fcd6762..00000000 --- a/mindplot/src/main/javascript/DesignerModel.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DesignerModel = new Class(/** @lends DesignerModel */{ - Implements:[mindplot.Events], - /** - * @implements {mindplot.Events} - * @constructs - * @param {{readOnly: Boolean, zoom: Number, saveOnLoad: Boolean, size: {width: Number, - * height: Number}, viewPort: {width: Number, height: Number}, container: String, - * persistenceManager: String, mapId: String, locale: String}} options - * options loaded from json config - * @see {@link ConfigParameters.md} - * @see {@link editor.html} - */ - initialize:function (options) { - this._zoom = options.zoom; - this._topics = []; - this._relationships = []; - }, - - /** @return {Number} zoom between 0.3 (largest text) and 1.9 */ - getZoom:function () { - return this._zoom; - }, - - /** @param {Number} zoom number between 0.3 and 1.9 to set the zoom to */ - setZoom:function (zoom) { - this._zoom = zoom; - }, - - /** @return {@link mindplot.Topic[]} all topics */ - getTopics:function () { - return this._topics; - }, - - /** @return {mindplot.Relationship[]} all relationships */ - getRelationships:function () { - return this._relationships; - }, - - /** @return {mindplot.CentralTopic} the central topic */ - getCentralTopic:function () { - var topics = this.getTopics(); - return topics[0]; - }, - - /** @return {mindplot.Topic[]} selected topics */ - filterSelectedTopics:function () { - var result = []; - for (var i = 0; i < this._topics.length; i++) { - if (this._topics[i].isOnFocus()) { - result.push(this._topics[i]); - } - } - return result; - }, - - /** - * @return {mindplot.Relationship[]} selected relationships - */ - filterSelectedRelationships:function () { - var result = []; - for (var i = 0; i < this._relationships.length; i++) { - if (this._relationships[i].isOnFocus()) { - result.push(this._relationships[i]); - } - } - return result; - }, - - /** - * @return {Array.} all topics and relationships - */ - getEntities:function () { - var result = [].append(this._topics); - result.append(this._relationships); - return result; - }, - - /** - * removes occurrences of the given topic from the topic array - * @param {mindplot.Topic} topic the topic to remove - */ - removeTopic:function (topic) { - $assert(topic, "topic can not be null"); - this._topics.erase(topic); - }, - - /** - * removes occurrences of the given relationship from the relationship array - * @param {mindplot.Relationship} rel the relationship to remove - */ - removeRelationship:function (rel) { - $assert(rel, "rel can not be null"); - this._relationships.erase(rel); - }, - - /** - * adds the given topic to the topic array - * @param {mindplot.Topic} topic the topic to add - * @throws will throw an error if topic is null or undefined - * @throws will throw an error if the topic's id is not a number - */ - addTopic:function (topic) { - $assert(topic, "topic can not be null"); - $assert(typeof topic.getId() == "number", "id is not a number:" + topic.getId()); - this._topics.push(topic); - }, - - /** - * adds the given relationship to the relationship array - * @param {mindplot.Relationship} rel the relationship to add - * @throws will throw an error if rel is null or undefined - */ - addRelationship:function (rel) { - $assert(rel, "rel can not be null"); - this._relationships.push(rel); - }, - - /** - * @param {Function=} validate a function to validate nodes - * @param {String=} errorMsg an error message to display if the validation fails - * @return {String} returns an array of the selected (and, if applicable, valid) topics' ids - */ - filterTopicsIds:function (validate, errorMsg) { - var result = []; - var topics = this.filterSelectedTopics(); - - - var isValid = true; - for (var i = 0; i < topics.length; i++) { - var selectedNode = topics[i]; - if ($defined(validate)) { - isValid = validate(selectedNode); - } - - // Add node only if it's valid. - if (isValid) { - result.push(selectedNode.getId()); - } else { - $notify(errorMsg); - } - } - return result; - }, - - /** - * @return {mindplot.Topic} the first selected topic if one or more are found by the - * filterSelectedTopics function, null otherwise - */ - selectedTopic:function () { - var topics = this.filterSelectedTopics(); - return (topics.length > 0) ? topics[0] : null; - }, - - /** - * @param {String} id the id of the topic to be retrieved - * @return {mindplot.Topic} the topic with the respective id - */ - findTopicById:function (id) { - var result = null; - for (var i = 0; i < this._topics.length; i++) { - var topic = this._topics[i]; - if (topic.getId() == id) { - result = topic; - break; - } - } - return result; - - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/DesignerUndoManager.js b/mindplot/src/main/javascript/DesignerUndoManager.js deleted file mode 100644 index a982f067..00000000 --- a/mindplot/src/main/javascript/DesignerUndoManager.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DesignerUndoManager = new Class({ - initialize: function(fireChange) { - this._undoQueue = []; - this._redoQueue = []; - this._baseId = 0; - }, - - enqueue:function(command) { - $assert(command, "Command can not be null"); - var length = this._undoQueue.length; - if (command.discardDuplicated && length > 0) { - // Skip duplicated events ... - var lastItem = this._undoQueue[length - 1]; - if (lastItem.discardDuplicated != command.discardDuplicated) { - this._undoQueue.push(command); - } - } else { - this._undoQueue.push(command); - } - this._redoQueue = []; - }, - - execUndo: function(commandContext) { - if (this._undoQueue.length > 0) { - var command = this._undoQueue.pop(); - this._redoQueue.push(command); - - command.undoExecute(commandContext); - } - }, - - execRedo: function(commandContext) { - if (this._redoQueue.length > 0) { - var command = this._redoQueue.pop(); - this._undoQueue.push(command); - command.execute(commandContext); - } - }, - - buildEvent: function() { - return {undoSteps: this._undoQueue.length, redoSteps:this._redoQueue.length}; - }, - - markAsChangeBase: function() { - var undoLength = this._undoQueue.length; - if (undoLength > 0) { - var command = this._undoQueue[undoLength - 1]; - this._baseId = command.getId(); - } else { - this._baseId = 0; - } - }, - - hasBeenChanged: function() { - var result = true; - var undoLength= this._undoQueue.length; - if (undoLength == 0 && this._baseId == 0) { - result = false; - } else if (undoLength > 0) { - var command = this._undoQueue[undoLength - 1]; - result = (this._baseId != command.getId()); - } - return result; - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/DragConnector.js b/mindplot/src/main/javascript/DragConnector.js deleted file mode 100644 index 2f2c9b1f..00000000 --- a/mindplot/src/main/javascript/DragConnector.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DragConnector = new Class({ - initialize:function (designerModel, workspace) { - $assert(designerModel, 'designerModel can not be null'); - $assert(workspace, 'workspace can not be null'); - - // this._layoutManager = layoutManager; - this._designerModel = designerModel; - this._workspace = workspace; - }, - - checkConnection:function (dragTopic) { - var topics = this._designerModel.getTopics(); - - // Must be disconnected from their current connection ?. - var candidates = this._searchConnectionCandidates(dragTopic); - var currentConnection = dragTopic.getConnectedToTopic(); - - - if (currentConnection && (candidates.length == 0 || candidates[0] != currentConnection)) { - dragTopic.disconnect(this._workspace); - } - - // Finally, connect nodes ... - if (!dragTopic.isConnected() && candidates.length > 0) { - dragTopic.connectTo(candidates[0]); - } - }, - - _searchConnectionCandidates:function (dragTopic) { - var topics = this._designerModel.getTopics(); - var draggedNode = dragTopic.getDraggedTopic(); - - // Drag node connects to the border ... - var dragTopicWidth = dragTopic.getSize ? dragTopic.getSize().width : 0; // Hack... - var xMouseGap = dragTopic.getPosition().x > 0 ? 0 : dragTopicWidth; - var sPos = {x:dragTopic.getPosition().x - xMouseGap, y:dragTopic.getPosition().y}; - - // Perform a initial filter to discard topics: - // - Exclude dragged topic - // - Exclude dragTopic pivot - // - Nodes that are collapsed - // - It's not part of the branch dragged itself - topics = topics.filter(function (topic) { - var result = draggedNode != topic; - result = result && topic != draggedNode; - result = result && !topic.areChildrenShrunken() && !topic.isCollapsed(); - result = result && !draggedNode.isChildTopic(topic); - return result; - }); - - // Filter all the nodes that are outside the vertical boundary: - // * The node is to out of the x scope - // * The x distance greater the vertical tolerated distance - topics = topics.filter(function (topic) { - var tpos = topic.getPosition(); - // Center topic has different alignment than the rest of the nodes. That's why i need to divide it by two... - var txborder = tpos.x + (topic.getSize().width / 2) * Math.sign(sPos.x); - var distance = (sPos.x - txborder) * Math.sign(sPos.x); - return distance > 0 && (distance < mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE); - - }); - - // Assign a priority based on the distance: - // - Alignment with the targetNode - // - Vertical distance - // - Horizontal proximity - // - It's already connected. - var currentConnection = dragTopic.getConnectedToTopic(); - var me = this; - topics = topics.sort(function (a, b) { - var aPos = a.getPosition(); - var bPos = b.getPosition(); - - var av = me._isVerticallyAligned(a.getSize(), aPos, sPos); - var bv = me._isVerticallyAligned(b.getSize(), bPos, sPos); - return me._proximityWeight(av, a, sPos, currentConnection) - me._proximityWeight(bv, b, sPos, currentConnection); - - }); - return topics; - }, - - _proximityWeight:function (isAligned, target, sPos, currentConnection) { - var tPos = target.getPosition(); - return (isAligned ? 0 : 200 ) + Math.abs(tPos.x - sPos.x) + Math.abs(tPos.y - sPos.y) + (currentConnection == target ? 0 : 100); - }, - - _isVerticallyAligned:function (targetSize, targetPosition, sourcePosition) { - - return Math.abs(sourcePosition.y - targetPosition.y) < targetSize.height / 2; - - } - -}); - -mindplot.DragConnector.MAX_VERTICAL_CONNECTION_TOLERANCE = 80; diff --git a/mindplot/src/main/javascript/DragManager.js b/mindplot/src/main/javascript/DragManager.js deleted file mode 100644 index dc51577e..00000000 --- a/mindplot/src/main/javascript/DragManager.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DragManager = new Class({ - initialize:function(workspace, eventDispatcher) { - this._workspace = workspace; - this._designerModel = workspace; - this._listeners = {}; - this._isDragInProcess = false; - this._eventDispatcher = eventDispatcher; - mindplot.DragTopic.init(this._workspace); - }, - - add : function(node) { - // Add behaviour ... - var workspace = this._workspace; - var screen = workspace.getScreenManager(); - var dragManager = this; - var me = this; - var mouseDownListener = function(event) { - if (workspace.isWorkspaceEventsEnabled()) { - // Disable double drag... - workspace.enableWorkspaceEvents(false); - - // Set initial position. - var layoutManager = me._eventDispatcher.getLayoutManager(); - var dragNode = node.createDragNode(layoutManager); - - // Register mouse move listener ... - var mouseMoveListener = dragManager._buildMouseMoveListener(workspace, dragNode, dragManager); - screen.addEvent('mousemove', mouseMoveListener); - - // Register mouse up listeners ... - var mouseUpListener = dragManager._buildMouseUpListener(workspace, node, dragNode, dragManager); - screen.addEvent('mouseup', mouseUpListener); - - // Change cursor. - window.document.body.style.cursor = 'move'; - } - }; - node.addEvent('mousedown', mouseDownListener); - }, - - remove : function(node) { - var nodes = this._topics; - var contained = false; - var index = -1; - for (var i = 0; i < nodes.length; i++) { - if (nodes[i] == node) { - contained = true; - index = i; - } - } - }, - - _buildMouseMoveListener : function(workspace, dragNode, dragManager) { - var screen = workspace.getScreenManager(); - var me = this; - var result = function(event) { - - if (!me._isDragInProcess) { - // Execute Listeners .. - var startDragListener = dragManager._listeners['startdragging']; - startDragListener(event, dragNode); - - // Add shadow node to the workspace. - workspace.append(dragNode); - - me._isDragInProcess = true; - } - - var pos = screen.getWorkspaceMousePosition(event); - dragNode.setPosition(pos.x, pos.y); - - // Call mouse move listeners ... - var dragListener = dragManager._listeners['dragging']; - if ($defined(dragListener)) { - dragListener(event, dragNode); - } - - event.preventDefault(); - - }; - dragManager._mouseMoveListener = result; - return result; - }, - - _buildMouseUpListener : function(workspace, node, dragNode, dragManager) { - var screen = workspace.getScreenManager(); - var me = this; - var result = function(event) { - $assert(dragNode.isDragTopic, 'dragNode must be an DragTopic'); - - // Remove all the events. - screen.removeEvent('mousemove', dragManager._mouseMoveListener); - screen.removeEvent('mouseup', dragManager._mouseUpListener); - - // Help GC - dragManager._mouseMoveListener = null; - dragManager._mouseUpListener = null; - - workspace.enableWorkspaceEvents(true); - // Change the cursor to the default. - window.document.body.style.cursor = 'default'; - - if (me._isDragInProcess) { - - // Execute Listeners only if the node has been moved. - var endDragListener = dragManager._listeners['enddragging']; - endDragListener(event, dragNode); - - // Remove drag node from the workspace. - dragNode.removeFromWorkspace(workspace); - - me._isDragInProcess = false; - } - - - }; - dragManager._mouseUpListener = result; - return result; - }, - - /** - * type: - * - startdragging. - * - dragging - * - enddragging - */ - addEvent : function(type, listener) { - this._listeners[type] = listener; - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/DragPivot.js b/mindplot/src/main/javascript/DragPivot.js deleted file mode 100644 index 2e6d918f..00000000 --- a/mindplot/src/main/javascript/DragPivot.js +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DragPivot = new Class({ - initialize:function() { - this._position = new core.Point(); - this._size = mindplot.DragTopic.PIVOT_SIZE; - - this._straightLine = this._buildStraightLine(); - this._curvedLine = this._buildCurvedLine(); - this._dragPivot = this._buildRect(); - this._connectRect = this._buildRect(); - this._targetTopic = null; - this._isVisible = false; - }, - - isVisible:function() { - return this._isVisible; - }, - - getTargetTopic : function() { - return this._targetTopic; - }, - - _buildStraightLine : function() { - var line = new web2d.CurvedLine(); - line.setStyle(web2d.CurvedLine.SIMPLE_LINE); - line.setStroke(1, 'solid', '#CC0033'); - line.setOpacity(0.4); - line.setVisibility(false); - return line; - }, - - _buildCurvedLine : function() { - var line = new web2d.CurvedLine(); - line.setStyle(web2d.CurvedLine.SIMPLE_LINE); - line.setStroke(1, 'solid', '#CC0033'); - line.setOpacity(0.4); - line.setVisibility(false); - return line; - }, - - - _redrawLine : function() { - // Update line position. - $assert(this.getTargetTopic(), 'Illegal invocation. Target node can not be null'); - - var pivotRect = this._getPivotRect(); - - // Pivot position has not changed. In this case, position change is not required. - var targetTopic = this.getTargetTopic(); - var position = this._position; - - // Calculate pivot connection point ... - var size = this._size; - var targetPosition = targetTopic.getPosition(); - var line = this._getConnectionLine(); - - // Update Line position. - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, position); - var pivotPoint = mindplot.util.Shape.calculateRectConnectionPoint(position, size, isAtRight); - line.setFrom(pivotPoint.x, pivotPoint.y); - - // Update rect position - var cx = position.x - (parseInt(size.width) / 2); - var cy = position.y - (parseInt(size.height) / 2); - pivotRect.setPosition(cx, cy); - - // Make line visible only when the position has been already changed. - // This solve several strange effects ;) - var targetPoint = targetTopic.workoutIncomingConnectionPoint(pivotPoint); - line.setTo(targetPoint.x, targetPoint.y); - }, - - setPosition : function(point) { - this._position = point; - this._redrawLine(); - }, - - getPosition : function() { - return this._position; - }, - - _buildRect : function() { - var size = this._size; - var rectAttributes = {fillColor:'#CC0033',opacity:0.4,width:size.width,height:size.height,strokeColor:'#FF9933'}; - var rect = new web2d.Rect(0, rectAttributes); - rect.setVisibility(false); - return rect; - }, - - _getPivotRect : function() { - return this._dragPivot; - }, - - getSize : function() { - var elem2d = this._getPivotRect(); - return elem2d.getSize(); - }, - - setVisibility : function(value) { - if (this.isVisible() != value) { - - var pivotRect = this._getPivotRect(); - pivotRect.setVisibility(value); - - var connectRect = this._connectRect; - connectRect.setVisibility(value); - - var line = this._getConnectionLine(); - if (line) { - line.setVisibility(value); - } - this._isVisible = value; - } - }, - - // If the node is connected, validate that there is a line connecting both... - _getConnectionLine : function() { - var result = null; - var parentTopic = this._targetTopic; - if (parentTopic) { - if (parentTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - result = this._straightLine; - } else { - result = this._curvedLine; - } - } - return result; - }, - - addToWorkspace : function(workspace) { - var pivotRect = this._getPivotRect(); - workspace.append(pivotRect); - - var connectToRect = this._connectRect; - workspace.append(connectToRect); - - // Add a hidden straight line ... - var straighLine = this._straightLine; - straighLine.setVisibility(false); - workspace.append(straighLine); - straighLine.moveToBack(); - - // Add a hidden curved line ... - var curvedLine = this._curvedLine; - curvedLine.setVisibility(false); - workspace.append(curvedLine); - curvedLine.moveToBack(); - - // Add a connect rect ... - var connectRect = this._connectRect; - connectRect.setVisibility(false); - workspace.append(connectRect); - connectRect.moveToBack(); - }, - - removeFromWorkspace : function(workspace) { - var shape = this._getPivotRect(); - workspace.removeChild(shape); - - var connectToRect = this._connectRect; - workspace.removeChild(connectToRect); - - if ($defined(this._straightLine)) { - workspace.removeChild(this._straightLine); - } - - if ($defined(this._curvedLine)) { - workspace.removeChild(this._curvedLine); - } - }, - - connectTo : function(targetTopic, position) { - $assert(!this._outgoingLine, 'Could not connect an already connected node'); - $assert(targetTopic != this, 'Circular connection are not allowed'); - $assert(position, 'position can not be null'); - $assert(targetTopic, 'parent can not be null'); - - this._position = position; - this._targetTopic = targetTopic; - - // Connected to Rect ... - var connectRect = this._connectRect; - var targetSize = targetTopic.getSize(); - - // Add 4 pixel in order to keep create a rect bigger than the topic. - var width = targetSize.width + 4; - var height = targetSize.height + 4; - - connectRect.setSize(width, height); - - var targetPosition = targetTopic.getPosition(); - var cx = Math.ceil(targetPosition.x - (width / 2)); - var cy = Math.ceil(targetPosition.y - (height / 2)); - connectRect.setPosition(cx, cy); - - // Change elements position ... - var pivotRect = this._getPivotRect(); - pivotRect.moveToFront(); - pivotRect.setPosition(position.x, position.y); - - this._redrawLine(); - }, - - disconnect : function(workspace) { - $assert(workspace, 'workspace can not be null.'); - $assert(this._targetTopic, 'There are not connected topic.'); - - this.setVisibility(false); - this._targetTopic = null; - } -}); diff --git a/mindplot/src/main/javascript/DragTopic.js b/mindplot/src/main/javascript/DragTopic.js deleted file mode 100644 index d0a55513..00000000 --- a/mindplot/src/main/javascript/DragTopic.js +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.DragTopic = new Class({ - initialize:function (dragShape, draggedNode, layoutManger) { - $assert(dragShape, 'Rect can not be null.'); - $assert(draggedNode, 'draggedNode can not be null.'); - $assert(layoutManger, 'layoutManger can not be null.'); - - this._elem2d = dragShape; - this._order = null; - this._draggedNode = draggedNode; - this._layoutManager = layoutManger; - this._position = new core.Point(); - this._isInWorkspace = false; - this._isFreeLayoutEnabled = false; - }, - - setOrder:function (order) { - this._order = order; - }, - - setPosition:function (x, y) { - // Update drag shadow position .... - var position = {x:x, y:y}; - if (this.isFreeLayoutOn() && this.isConnected()) { - var _layoutManager = this._layoutManager; - var par = this.getConnectedToTopic(); - position = _layoutManager.predict(par.getId(), this._draggedNode.getId(), position, true).position; - } - this._position.setValue(position.x, position.y); - - // Elements are positioned in the center. - // All topic element must be positioned based on the innerShape. - var draggedNode = this._draggedNode; - var size = draggedNode.getSize(); - var cx = position.x - (position.x > 0 ? 0 : size.width); - var cy = Math.ceil(position.y - (size.height / 2)); - this._elem2d.setPosition(cx, cy); - - // In case is not free, pivot must be draw ... - if (this.isConnected() && !this.isFreeLayoutOn()) { - var parent = this.getConnectedToTopic(); - var predict = this._layoutManager.predict(parent.getId(), this._draggedNode.getId(), this.getPosition()); - if (this._order != predict.order) { - var dragPivot = this._getDragPivot(); - var pivotPosition = predict.position; - dragPivot.connectTo(parent, pivotPosition); - this.setOrder(predict.order); - } - } - }, - - updateFreeLayout:function (event) { - var isFreeEnabled = (event.metaKey && Browser.Platform.mac) || (event.ctrlKey && !Browser.Platform.mac); - if (this.isFreeLayoutOn() != isFreeEnabled) { - var dragPivot = this._getDragPivot(); - dragPivot.setVisibility(!isFreeEnabled); - this._isFreeLayoutEnabled = isFreeEnabled; - } - }, - - setVisibility:function (value) { - var dragPivot = this._getDragPivot(); - dragPivot.setVisibility(value); - }, - - isVisible:function () { - var dragPivot = this._getDragPivot(); - return dragPivot.isVisible(); - }, - - getInnerShape:function () { - return this._elem2d; - }, - - disconnect:function (workspace) { - // Clear connection line ... - var dragPivot = this._getDragPivot(); - dragPivot.disconnect(workspace); - }, - - connectTo:function (parent) { - $assert(parent, 'Parent connection node can not be null.'); - - // Where it should be connected ? - var predict = designer._eventBussDispatcher._layoutManager.predict(parent.getId(), this._draggedNode.getId(), this.getPosition()); - - // Connect pivot ... - var dragPivot = this._getDragPivot(); - var position = predict.position; - dragPivot.connectTo(parent, position); - dragPivot.setVisibility(true); - - this.setOrder(predict.order); - }, - - getDraggedTopic:function () { - return this._draggedNode; - }, - - removeFromWorkspace:function (workspace) { - if (this._isInWorkspace) { - // Remove drag shadow. - workspace.removeChild(this._elem2d); - - // Remove pivot shape. To improve performance it will not be removed. Only the visibility will be changed. - var dragPivot = this._getDragPivot(); - dragPivot.setVisibility(false); - - this._isInWorkspace = false; - } - }, - - isInWorkspace:function () { - return this._isInWorkspace; - }, - - addToWorkspace:function (workspace) { - if (!this._isInWorkspace) { - workspace.append(this._elem2d); - var dragPivot = this._getDragPivot(); - dragPivot.addToWorkspace(workspace); - this._isInWorkspace = true; - } - }, - - _getDragPivot:function () { - return mindplot.DragTopic.__getDragPivot(); - }, - - getPosition:function () { - return this._position; - }, - - isDragTopic:function () { - return true; - }, - - applyChanges:function (workspace) { - $assert(workspace, 'workspace can not be null'); - - - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - var draggedTopic = this.getDraggedTopic(); - var topicId = draggedTopic.getId(); - var position = this.getPosition(); - - if (!this.isFreeLayoutOn()) { - var order = null; - var parent = null; - var isDragConnected = this.isConnected(); - if (isDragConnected) { - var targetTopic = this.getConnectedToTopic(); - order = this._order; - parent = targetTopic; - } - - // If the node is not connected, position based on the original drag topic position. - actionDispatcher.dragTopic(topicId, position, order, parent); - } else { - actionDispatcher.moveTopic(topicId, position); - } - }, - - getConnectedToTopic:function () { - var dragPivot = this._getDragPivot(); - return dragPivot.getTargetTopic(); - }, - - isConnected:function () { - return this.getConnectedToTopic() != null; - }, - - isFreeLayoutOn:function () { -// return this._isFreeLayoutEnabled; - // Disable free layout ... - return false; - } - -}); - -mindplot.DragTopic.PIVOT_SIZE = {width:50, height:6}; - -mindplot.DragTopic.init = function (workspace) { - - $assert(workspace, "workspace can not be null"); - var pivot = mindplot.DragTopic.__getDragPivot(); - workspace.append(pivot); -}; - -mindplot.DragTopic.__getDragPivot = function () { - var result = mindplot.DragTopic._dragPivot; - if (!$defined(result)) { - result = new mindplot.DragPivot(); - mindplot.DragTopic._dragPivot = result; - } - return result; -}; - diff --git a/mindplot/src/main/javascript/EditorOptions.js b/mindplot/src/main/javascript/EditorOptions.js deleted file mode 100644 index d2d73742..00000000 --- a/mindplot/src/main/javascript/EditorOptions.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.EditorOptions = -{ - LayoutManager:"OriginalLayout", -// LayoutManager:"FreeMindLayout", - textEditor:"TextEditor" -// textEditor:"RichTextEditor" -}; diff --git a/mindplot/src/main/javascript/EditorProperties.js b/mindplot/src/main/javascript/EditorProperties.js deleted file mode 100644 index ef7e345d..00000000 --- a/mindplot/src/main/javascript/EditorProperties.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.EditorProperties = new Class({ - initialize: function () { - this._zoom = 0; - this._position = 0; - }, - - setZoom: function (zoom) { - this._zoom = zoom; - }, - - getZoom: function () { - return this._zoom; - }, - - asProperties: function () { - return "zoom=" + this._zoom + "\n"; - } -}); - - - - diff --git a/mindplot/src/main/javascript/Events.js b/mindplot/src/main/javascript/Events.js deleted file mode 100644 index fe239881..00000000 --- a/mindplot/src/main/javascript/Events.js +++ /dev/null @@ -1,41 +0,0 @@ -mindplot.Events = new Class({ - - $events: {}, - - _removeOn: function (string) { - return string.replace(/^on([A-Z])/, function (full, first) { - return first.toLowerCase(); - }); - }, - - addEvent: function (type, fn, internal) { - type = this._removeOn(type); - - this.$events[type] = (this.$events[type] || []).include(fn); - if (internal) fn.internal = true; - return this; - }, - - fireEvent: function (type, args, delay) { - type = this._removeOn(type); - var events = this.$events[type]; - if (!events) return this; - args = Array.from(args); - _.each(events, function (fn) { - if (delay) fn.delay(delay, this, args); - else fn.apply(this, args); - }, this); - return this; - }, - - removeEvent: function (type, fn) { - type = this._removeOn(type); - var events = this.$events[type]; - if (events && !fn.internal) { - var index = events.indexOf(fn); - if (index != -1) events.splice(index, 1); - } - return this; - } - -}); diff --git a/mindplot/src/main/javascript/Icon.js b/mindplot/src/main/javascript/Icon.js deleted file mode 100644 index 491808a1..00000000 --- a/mindplot/src/main/javascript/Icon.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Icon = new Class({ - initialize: function (url) { - $assert(url, 'topic can not be null'); - this._image = new web2d.Image(); - this._image.setHref(url); - this._image.setSize(mindplot.Icon.SIZE, mindplot.Icon.SIZE); - }, - - getImage: function () { - return this._image; - }, - - setGroup: function (group) { - this._group = group; - }, - - getGroup: function () { - return this._group; - }, - - getSize: function () { - return this._image.getSize(); - }, - - getPosition: function () { - return this._image.getPosition(); - }, - - addEvent: function (type, fnc) { - this._image.addEvent(type, fnc); - }, - - remove: function () { - throw "Unsupported operation"; - } -}); - -mindplot.Icon.SIZE = 90; - - - - diff --git a/mindplot/src/main/javascript/IconGroup.js b/mindplot/src/main/javascript/IconGroup.js deleted file mode 100644 index 6c8a3d67..00000000 --- a/mindplot/src/main/javascript/IconGroup.js +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.IconGroup = new Class(/**@lends IconGroup */{ - /** - * @constructs - * @param topicId - * @param iconSize - * @throws will throw an error if topicId is null or undefined - * @throws will throw an error if iconSize is null or undefined - */ - initialize: function (topicId, iconSize) { - $assert($defined(topicId), "topicId can not be null"); - $assert($defined(iconSize), "iconSize can not be null"); - - this._icons = []; - this._group = new web2d.Group({ - width: 0, - height: iconSize, - x: 0, - y: 0, - coordSizeWidth: 0, - coordSizeHeight: 100 - }); - this._removeTip = new mindplot.IconGroup.RemoveTip(this._group, topicId); - this.seIconSize(iconSize, iconSize); - - this._registerListeners(); - - }, - - /** */ - setPosition: function (x, y) { - this._group.setPosition(x, y); - }, - - /** */ - getPosition: function () { - return this._group.getPosition(); - }, - - /** */ - getNativeElement: function () { - return this._group; - }, - - /** */ - getSize: function () { - return this._group.getSize(); - }, - - /** */ - seIconSize: function (width, height) { - this._iconSize = {width: width, height: height}; - this._resize(this._icons.length); - }, - - /** - * @param icon the icon to be added to the icon group - * @param {Boolean} remove - * @throws will throw an error if icon is not defined - */ - addIcon: function (icon, remove) { - $defined(icon, "icon is not defined"); - - icon.setGroup(this); - this._icons.push(icon); - - // Adjust group and position ... - this._resize(this._icons.length); - this._positionIcon(icon, this._icons.length - 1); - - var imageShape = icon.getImage(); - this._group.append(imageShape); - - // Register event for the group .. - if (remove) { - this._removeTip.decorate(this._topicId, icon); - } - }, - - _findIconFromModel: function (iconModel) { - var result = null; - _.each(this._icons, function (icon) { - var elModel = icon.getModel(); - if (elModel.getId() == iconModel.getId()) { - result = icon; - } - }, this); - - if (result == null) { - throw new Error("Icon can no be found:" + iconModel.getId() + ", Icons:" + this._icons); - } - - return result; - }, - - /** */ - removeIconByModel: function (featureModel) { - $assert(featureModel, "featureModel can not be null"); - - var icon = this._findIconFromModel(featureModel); - this._removeIcon(icon); - }, - - _removeIcon: function (icon) { - $assert(icon, "icon can not be null"); - - this._removeTip.close(0); - this._group.removeChild(icon.getImage()); - - this._icons.erase(icon); - this._resize(this._icons.length); - var me = this; - // Add all again ... - _.each(this._icons, function (elem, i) { - me._positionIcon(elem, i); - }); - }, - - /** */ - moveToFront: function () { - this._group.moveToFront(); - }, - - _registerListeners: function () { - this._group.addEvent('click', function (event) { - // Avoid node creation ... - event.stopPropagation(); - - }); - - this._group.addEvent('dblclick', function (event) { - event.stopPropagation(); - - }); - }, - - _resize: function (iconsLength) { - this._group.setSize(iconsLength * this._iconSize.width, this._iconSize.height); - - var iconSize = mindplot.Icon.SIZE + (mindplot.IconGroup.ICON_PADDING * 2); - this._group.setCoordSize(iconsLength * iconSize, iconSize); - }, - - _positionIcon: function (icon, order) { - - var iconSize = mindplot.Icon.SIZE + (mindplot.IconGroup.ICON_PADDING * 2); - icon.getImage().setPosition(iconSize * order + mindplot.IconGroup.ICON_PADDING, mindplot.IconGroup.ICON_PADDING); - } -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.IconGroup.ICON_PADDING = 5; - -mindplot.IconGroup.RemoveTip = new Class(/** @lends IconGroup.RemoveTip */{ - /** - * @classdesc inner class of IconGroup - * @constructs - * @param container - */ - initialize: function (container) { - $assert(container, "group can not be null"); - this._fadeElem = container; - }, - - - /** - * @param topicId - * @param icon - * @throws will throw an error if icon is null or undefined - */ - show: function (topicId, icon) { - $assert(icon, 'icon can not be null'); - - // Nothing to do ... - if (this._activeIcon != icon) { - // If there is an active icon, close it first ... - if (this._activeIcon) { - this.close(0); - } - - // Now, let move the position the icon... - var pos = icon.getPosition(); - - // Register events ... - var widget = this._buildWeb2d(); - widget.addEvent('click', function () { - icon.remove(); - }); - - var me = this; - - widget.addEvent('mouseover', function () { - me.show(topicId, icon); - }); - - widget.addEvent('mouseout', function () { - me.hide(); - }); - - widget.setPosition(pos.x + 80, pos.y - 50); - this._fadeElem.append(widget); - - // Setup current element ... - this._activeIcon = icon; - this._widget = widget; - - } else { - clearTimeout(this._closeTimeoutId); - } - }, - - /** */ - hide: function () { - this.close(200); - }, - - /** - * @param delay - */ - close: function (delay) { - - // This is not ok, trying to close the same dialog twice ? - if (this._closeTimeoutId) { - clearTimeout(this._closeTimeoutId) - } - - var me = this; - if (this._activeIcon) { - var widget = this._widget; - var close = function () { - me._activeIcon = null; - me._fadeElem.removeChild(widget); - me._widget = null; - me._closeTimeoutId = null; - }; - - if (!$defined(delay) || delay == 0) { - close(); - } - else { - this._closeTimeoutId = close.delay(delay); - } - } - }, - - _buildWeb2d: function () { - var result = new web2d.Group({ - width: 10, - height: 10, - x: 0, - y: 0, - coordSizeWidth: 10, - coordSizeHeight: 10 - }); - - var outerRect = new web2d.Rect(0, { - x: 0, - y: 0, - width: 10, - height: 10, - stroke: '0', - fillColor: 'black' - }); - result.append(outerRect); - outerRect.setCursor('pointer'); - - var innerRect = new web2d.Rect(0, { - x: 1, - y: 1, - width: 8, - height: 8, - stroke: '1 solid white', - fillColor: 'gray' - }); - result.append(innerRect); - - var line = new web2d.Line({stroke: '1 solid white'}); - line.setFrom(1, 1); - line.setTo(9, 9); - result.append(line); - - var line2 = new web2d.Line({stroke: '1 solid white'}); - line2.setFrom(1, 9); - line2.setTo(9, 1); - result.append(line2); - - // Some events ... - result.addEvent('mouseover', function () { - innerRect.setFill('#CC0033'); - }); - result.addEvent('mouseout', function () { - innerRect.setFill('gray'); - }); - - result.setSize(50, 50); - return result; - }, - - /** - * @param topicId - * @param icon - */ - decorate: function (topicId, icon) { - - var me = this; - - if (!icon.__remove) { - icon.addEvent('mouseover', function () { - me.show(topicId, icon); - }); - - icon.addEvent('mouseout', function () { - me.hide(); - }); - icon.__remove = true; - } - } - -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/ImageIcon.js b/mindplot/src/main/javascript/ImageIcon.js deleted file mode 100644 index a2fe6763..00000000 --- a/mindplot/src/main/javascript/ImageIcon.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ImageIcon = new Class({ - Extends: mindplot.Icon, - initialize: function (topic, iconModel, readOnly) { - $assert(iconModel, 'iconModel can not be null'); - $assert(topic, 'topic can not be null'); - - this._topicId = topic.getId(); - this._featureModel = iconModel; - - // Build graph image representation ... - var iconType = iconModel.getIconType(); - var imgUrl = this._getImageUrl(iconType); - this.parent(imgUrl); - - if (!readOnly) { - - //Icon - var image = this.getImage(); - var me = this; - image.addEvent('click', function () { - - var iconType = iconModel.getIconType(); - var newIconType = me._getNextFamilyIconId(iconType); - iconModel.setIconType(newIconType); - - var imgUrl = me._getImageUrl(newIconType); - me._image.setHref(imgUrl); - - }); - this._image.setCursor('pointer'); - } - }, - - _getImageUrl: function (iconId) { - return "icons/" + iconId + ".png"; - }, - - getModel: function () { - return this._featureModel; - }, - - _getNextFamilyIconId: function (iconId) { - - var familyIcons = this._getFamilyIcons(iconId); - $assert(familyIcons != null, "Family Icon not found!"); - - var result = null; - for (var i = 0; i < familyIcons.length && result == null; i++) { - if (familyIcons[i] == iconId) { - //Is last one? - if (i == (familyIcons.length - 1)) { - result = familyIcons[0]; - } else { - result = familyIcons[i + 1]; - } - break; - } - } - - return result; - }, - - _getFamilyIcons: function (iconId) { - $assert(iconId != null, "id must not be null"); - $assert(iconId.indexOf("_") != -1, "Invalid icon id (it must contain '_')"); - - var result = null; - for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i++) { - var family = mindplot.ImageIcon.prototype.ICON_FAMILIES[i]; - var iconFamilyId = iconId.substr(0, iconId.indexOf("_")); - - if (family.id == iconFamilyId) { - result = family.icons; - break; - } - } - return result; - }, - - remove: function () { - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - var featureId = this._featureModel.getId(); - var topicId = this._topicId; - actionDispatcher.removeFeatureFromTopic(topicId, featureId); - } -}); - -mindplot.ImageIcon.prototype.ICON_FAMILIES = [ - {"id": "face", "icons": ["face_plain", "face_sad", "face_crying", "face_smile", "face_surprise", "face_wink"]}, - {"id": "funy", "icons": ["funy_angel", "funy_devilish", "funy_glasses", "funy_grin", "funy_kiss", "funy_monkey"]}, - {"id": "conn", "icons": ["conn_connect", "conn_disconnect"]}, - { - "id": "sport", - "icons": ["sport_basketball", "sport_football", "sport_golf", "sport_raquet", "sport_shuttlecock", "sport_soccer", "sport_tennis"] - }, - {"id": "bulb", "icons": ["bulb_light_on", "bulb_light_off"]}, - {"id": "thumb", "icons": ["thumb_thumb_up", "thumb_thumb_down"]}, - {"id": "tick", "icons": ["tick_tick", "tick_cross"]}, - { - "id": "onoff", - "icons": ["onoff_clock", "onoff_clock_red", "onoff_add", "onoff_delete", "onoff_status_offline", "onoff_status_online"] - }, - { - "id": "money", - "icons": ["money_money", "money_dollar", "money_euro", "money_pound", "money_yen", "money_coins", "money_ruby"] - }, - {"id": "time", "icons": ["time_calendar", "time_clock", "time_hourglass"]}, - { - "id": "number", - "icons": ["number_1", "number_2", "number_3", "number_4", "number_5", "number_6", "number_7", "number_8", "number_9"] - }, - {"id": "chart", "icons": ["chart_bar", "chart_line", "chart_curve", "chart_pie", "chart_organisation"]}, - {"id": "sign", "icons": ["sign_warning", "sign_info", "sign_stop", "sign_help", "sign_cancel"]}, - { - "id": "hard", - "icons": ["hard_cd", "hard_computer", "hard_controller", "hard_driver_disk", "hard_ipod", "hard_keyboard", "hard_mouse", "hard_printer"] - }, - { - "id": "soft", - "icons": ["soft_bug", "soft_cursor", "soft_database_table", "soft_database", "soft_feed", "soft_folder_explore", "soft_rss", "soft_penguin"] - }, - {"id": "arrow", "icons": ["arrow_up", "arrow_down", "arrow_left", "arrow_right"]}, - { - "id": "arrowc", - "icons": ["arrowc_rotate_anticlockwise", "arrowc_rotate_clockwise", "arrowc_turn_left", "arrowc_turn_right"] - }, - {"id": "people", "icons": ["people_group", "people_male1", "people_male2", "people_female1", "people_female2"]}, - {"id": "mail", "icons": ["mail_envelop", "mail_mailbox", "mail_edit", "mail_list"]}, - {"id": "flag", "icons": ["flag_blue", "flag_green", "flag_orange", "flag_pink", "flag_purple", "flag_yellow"]}, - { - "id": "bullet", - "icons": ["bullet_black", "bullet_blue", "bullet_green", "bullet_orange", "bullet_red", "bullet_pink", "bullet_purple"] - }, - {"id": "tag", "icons": ["tag_blue", "tag_green", "tag_orange", "tag_red", "tag_pink", "tag_yellow"]}, - { - "id": "object", - "icons": ["object_bell", "object_clanbomber", "object_key", "object_pencil", "object_phone", "object_magnifier", "object_clip", "object_music", "object_star", "object_wizard", "object_house", "object_cake", "object_camera", "object_palette", "object_rainbow"] - }, - { - "id": "weather", - "icons": ["weather_clear-night", "weather_clear", "weather_few-clouds-night", "weather_few-clouds", "weather_overcast", "weather_severe-alert", "weather_showers-scattered", "weather_showers", "weather_snow", "weather_storm"] - }, - {"id": "task", "icons": ["task_0", "task_25", "task_50", "task_75", "task_100"]} -]; - diff --git a/mindplot/src/main/javascript/Keyboard.js b/mindplot/src/main/javascript/Keyboard.js deleted file mode 100644 index dbb80180..00000000 --- a/mindplot/src/main/javascript/Keyboard.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Keyboard = new Class({ - - initialize: function () { - }, - - addShortcut: function (shortcuts, callback) { - if (!$.isArray(shortcuts)) { - shortcuts = [shortcuts]; - } - _.each(shortcuts, function (shortcut) { - $(document).bind('keydown', shortcut, callback); - }); - } - -}); diff --git a/mindplot/src/main/javascript/LinkIcon.js b/mindplot/src/main/javascript/LinkIcon.js deleted file mode 100644 index cd57959c..00000000 --- a/mindplot/src/main/javascript/LinkIcon.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.LinkIcon = new Class({ - - Extends: mindplot.Icon, - initialize: function (topic, linkModel, readOnly) { - $assert(topic, 'topic can not be null'); - $assert(linkModel, 'linkModel can not be null'); - - this.parent(mindplot.LinkIcon.IMAGE_URL); - this._linksModel = linkModel; - this._topic = topic; - this._readOnly = readOnly; - - this._registerEvents(); - }, - - _registerEvents: function () { - this._image.setCursor('pointer'); - this._tip = new mindplot.widget.LinkIconTooltip(this); - - var me = this; - if (!this._readOnly) { - // Add on click event to open the editor ... - this.addEvent('click', function (event) { - me._tip.hide(); - me._topic.showLinkEditor(); - event.stopPropagation(); - }); - //FIXME: we shouldn't have timeout of that.. - this.addEvent("mouseleave", function (event) { - window.setTimeout(function () { - if (!$("#linkPopover:hover").length) { - me._tip.hide(); - } - event.stopPropagation(); - }, 100) - }); - } - - $(this.getImage()._peer._native).mouseenter(function () { - me._tip.show(); - }) - }, - - getModel: function () { - return this._linksModel; - } -}); -mindplot.LinkIcon.IMAGE_URL = "images/links.png"; - - \ No newline at end of file diff --git a/mindplot/src/main/javascript/LocalStorageManager.js b/mindplot/src/main/javascript/LocalStorageManager.js deleted file mode 100644 index 7063a187..00000000 --- a/mindplot/src/main/javascript/LocalStorageManager.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.LocalStorageManager = new Class({ - Extends: mindplot.PersistenceManager, - initialize: function (documentUrl, forceLoad) { - this.parent(); - this.documentUrl = documentUrl; - this.forceLoad = forceLoad; - }, - - saveMapXml: function (mapId, mapXml, pref, saveHistory, events) { - localStorage.setItem(mapId + "-xml", mapXml); - }, - - discardChanges: function (mapId) { - localStorage.removeItem(mapId + "-xml"); - }, - - loadMapDom: function (mapId) { - var xml = localStorage.getItem(mapId + "-xml"); - if (xml == null || this.forceLoad) { - $.ajax({ - url: this.documentUrl.replace("{id}", mapId), - headers: {"Content-Type": "text/plain", "Accept": "application/xml"}, - type: 'get', - dataType: "text", - async: false, - success: function (response) { - xml = response; - } - }); - // If I could not load it from a file, hard code one. - if (xml == null) { - throw new Error("Map could not be loaded"); - } - } - - return jQuery.parseXML(xml); - }, - - unlockMap: function (mindmap) { - // Ignore, no implementation required ... - } - } -); - - diff --git a/mindplot/src/main/javascript/MainTopic.js b/mindplot/src/main/javascript/MainTopic.js deleted file mode 100644 index 29d3cd60..00000000 --- a/mindplot/src/main/javascript/MainTopic.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.MainTopic = new Class(/** @lends MainTopic */{ - Extends: mindplot.Topic, - /** - * @extends mindplot.Topic - * @constructs - * @param model - * @param options - */ - initialize: function (model, options) { - this.parent(model, options); - }, - - INNER_RECT_ATTRIBUTES: {stroke: '0.5 solid #009900'}, - - _buildDragShape: function () { - var innerShape = this._buildShape(this.INNER_RECT_ATTRIBUTES, this.getShapeType()); - var size = this.getSize(); - innerShape.setSize(size.width, size.height); - innerShape.setPosition(0, 0); - innerShape.setOpacity(0.5); - innerShape.setCursor('default'); - innerShape.setVisibility(true); - - var brColor = this.getBorderColor(); - innerShape.setAttribute("strokeColor", brColor); - - var bgColor = this.getBackgroundColor(); - innerShape.setAttribute("fillColor", bgColor); - - // Create group ... - var groupAttributes = {width: 100, height: 100, coordSizeWidth: 100, coordSizeHeight: 100}; - var group = new web2d.Group(groupAttributes); - group.append(innerShape); - - // Add Text ... - if (this.getShapeType() != mindplot.model.TopicShape.IMAGE) { - var textShape = this._buildTextShape(true); - var text = this.getText(); - textShape.setText(text); - textShape.setOpacity(0.5); - group.append(textShape); - } - return group; - }, - - /** */ - updateTopicShape: function (targetTopic, workspace) { - // Change figure based on the connected topic ... - var model = this.getModel(); - var shapeType = model.getShapeType(); - if (!targetTopic.isCentralTopic()) { - if (!$defined(shapeType)) { - // Get the real shape type ... - shapeType = this.getShapeType(); - this._setShapeType(shapeType, false); - } - } - }, - - /** */ - disconnect: function (workspace) { - this.parent(workspace); - var size = this.getSize(); - - var model = this.getModel(); - var shapeType = model.getShapeType(); - if (!$defined(shapeType)) { - // Change figure ... - shapeType = this.getShapeType(); - this._setShapeType(mindplot.model.TopicShape.ROUNDED_RECT, false); - } - var innerShape = this.getInnerShape(); - innerShape.setVisibility(true); - }, - - _updatePositionOnChangeSize: function (oldSize, newSize) { - - var xOffset = Math.round((newSize.width - oldSize.width) / 2); - var pos = this.getPosition(); - if ($defined(pos)) { - if (pos.x > 0) { - pos.x = pos.x + xOffset; - } else { - pos.x = pos.x - xOffset; - } - this.setPosition(pos); - } - }, - - /** */ - workoutIncomingConnectionPoint: function (sourcePosition) { - return mindplot.util.Shape.workoutIncomingConnectionPoint(this, sourcePosition); - }, - - /** */ - workoutOutgoingConnectionPoint: function (targetPosition) { - $assert(targetPosition, 'targetPoint can not be null'); - var pos = this.getPosition(); - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); - var size = this.getSize(); - - var result; - if (this.getShapeType() == mindplot.model.TopicShape.LINE) { - - result = new core.Point(); - var groupPosition = this._elem2d.getPosition(); - var innerShareSize = this.getInnerShape().getSize(); - - if (innerShareSize) { - var magicCorrectionNumber = 0.3; - if (!isAtRight) { - result.x = groupPosition.x + innerShareSize.width - magicCorrectionNumber; - } else { - result.x = groupPosition.x + magicCorrectionNumber; - } - result.y = groupPosition.y + innerShareSize.height; - } else { - // Hack: When the size has not being defined. This is because the node has not being added. - // Try to do our best ... - if (!isAtRight) { - result.x = pos.x + (size.width / 2); - } else { - result.x = pos.x - (size.width / 2); - } - result.y = pos.y + (size.height / 2); - } - - } else { - result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true); - } - return result; - } - -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/Messages.js b/mindplot/src/main/javascript/Messages.js deleted file mode 100644 index 0e73f26c..00000000 --- a/mindplot/src/main/javascript/Messages.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Messages = new Class({ - Static: { - init: function (locale) { - locale = $defined(locale) ? locale : 'en'; - var bundle = mindplot.Messages.BUNDLES[locale]; - if (bundle == null && locale.indexOf("_") != -1) { - // Try to locate without the specialization ... - locale = locale.substring(0, locale.indexOf("_")); - bundle = mindplot.Messages.BUNDLES[locale]; - } - mindplot.Messages.__bundle = bundle; - } - } -}); - -$msg = function (key) { - if (!mindplot.Messages.__bundle) { - mindplot.Messages.init('en'); - } - - var msg = mindplot.Messages.__bundle[key]; - return msg ? msg : key; -}; - -mindplot.Messages.BUNDLES = {}; - diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js deleted file mode 100644 index c94e308d..00000000 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.MultilineTextEditor = new Class({ - Extends: mindplot.Events, - initialize: function () { - this._topic = null; - this._timeoutId = -1; - }, - - _buildEditor: function () { - - var result = $('
') - .attr('id', 'textContainer') - .css({ - display: "none", - zIndex: "8", - overflow: "hidden", - border: "0 none" - }); - - - var textareaElem = $('') - .css({ - border: "1px gray dashed", - background: "rgba(98, 135, 167, .3)", - outline: '0 none', - resize: 'none', - overflow: "hidden" - }); - - result.append(textareaElem); - return result; - }, - - _registerEvents: function (containerElem) { - var textareaElem = this._getTextareaElem(); - var me = this; - textareaElem.on('keydown', function (event) { - switch (jQuery.hotkeys.specialKeys[event.keyCode]) { - case 'esc': - me.close(false); - break; - case 'enter': - if (event.metaKey || event.ctrlKey) { - - // Add return ... - var text = textareaElem.val(); - var cursorPosition = text.length; - if (textareaElem.selectionStart) { - cursorPosition = textareaElem.selectionStart; - } - - var head = text.substring(0, cursorPosition); - var tail = ""; - if (cursorPosition < text.length) { - tail = text.substring(cursorPosition, text.length); - } - textareaElem.val(head + "\n" + tail); - - // Position cursor ... - if (textareaElem[0].setSelectionRange) { - textareaElem.focus(); - textareaElem[0].setSelectionRange(cursorPosition + 1, cursorPosition + 1); - } else if (textareaElem.createTextRange) { - var range = textareaElem.createTextRange(); - range.moveStart('character', cursorPosition + 1); - range.select(); - } - - } - else { - me.close(true); - } - break; - case 'tab': - event.preventDefault(); - var start = $(this).get(0).selectionStart; - var end = $(this).get(0).selectionEnd; - - // set textarea value to: text before caret + tab + text after caret - $(this).val($(this).val().substring(0, start) + "\t" + $(this).val().substring(end)); - - // put caret at right position again - $(this).get(0).selectionStart = $(this).get(0).selectionEnd = start + 1; - break; - } - event.stopPropagation(); - }); - - textareaElem.on('keypress', function (event) { - event.stopPropagation(); - }); - - textareaElem.on('keyup', function (event) { - var text = me._getTextareaElem().val(); - me.fireEvent('input', [event, text]); - me._adjustEditorSize(); - }); - - // If the user clicks on the input, all event must be ignored ... - containerElem.on('click', function (event) { - event.stopPropagation(); - }); - containerElem.on('dblclick', function (event) { - event.stopPropagation(); - }); - containerElem.on('mousedown', function (event) { - event.stopPropagation(); - }); - }, - - _adjustEditorSize: function () { - - if (this.isVisible()) { - var textElem = this._getTextareaElem(); - - var lines = textElem.val().split('\n'); - var maxLineLength = 1; - _.each(lines, function (line) { - if (maxLineLength < line.length) - maxLineLength = line.length; - }); - - textElem.attr('cols', maxLineLength); - textElem.attr('rows', lines.length); - - this._containerElem.css({ - width: (maxLineLength + 3) + 'em', - height: textElem.height() - }); - } - }, - - isVisible: function () { - return $defined(this._containerElem) && this._containerElem.css('display') == 'block'; - }, - - _updateModel: function () { - - if (this._topic.getText() != this._getText()) { - var text = this._getText(); - var topicId = this._topic.getId(); - - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.changeTextToTopic([topicId], text); - } - }, - - show: function (topic, text) { - // Close a previous node editor if it's opened ... - if (this._topic) { - this.close(false); - } - - this._topic = topic; - if (!this.isVisible()) { - //Create editor ui - var containerElem = this._buildEditor(); - $('body').append(containerElem); - - this._containerElem = containerElem; - this._registerEvents(containerElem); - this._showEditor(text); - } - }, - - _showEditor: function (defaultText) { - - var topic = this._topic; - - // Hide topic text ... - topic.getTextShape().setVisibility(false); - - // Set Editor Style - var nodeText = topic.getTextShape(); - var font = nodeText.getFont(); - font.size = nodeText.getHtmlFontSize(); - font.color = nodeText.getColor(); - this._setStyle(font); - var me = this; - // Set editor's initial size - var displayFunc = function () { - // Position the editor and set the size... - var textShape = topic.getTextShape(); - - me._containerElem.css('display', 'block'); - - //FIXME: Im not sure if this is best way... - var shapePosition = textShape.getNativePosition(); - me._containerElem.offset(shapePosition); - - // Set editor's initial text ... - var text = $defined(defaultText) ? defaultText : topic.getText(); - me._setText(text); - - // Set the element focus and select the current text ... - var inputElem = me._getTextareaElem(); - me._positionCursor(inputElem, !$defined(defaultText)); - - }; - - this._timeoutId = displayFunc.delay(10); - }, - - _setStyle: function (fontStyle) { - var inputField = this._getTextareaElem(); - if (!$defined(fontStyle.font)) { - fontStyle.font = "Arial"; - } - if (!$defined(fontStyle.style)) { - fontStyle.style = "normal"; - } - if (!$defined(fontStyle.weight)) { - fontStyle.weight = "normal"; - } - if (!$defined(fontStyle.size)) { - fontStyle.size = 12; - } - var style = { - fontSize: fontStyle.size + "px", - fontFamily: fontStyle.font, - fontStyle: fontStyle.style, - fontWeight: fontStyle.weight, - color: fontStyle.color - }; - inputField.css(style); - this._containerElem.css(style); - }, - - _setText: function (text) { - var textareaElem = this._getTextareaElem(); - textareaElem.val(text); - this._adjustEditorSize(); - }, - - _getText: function () { - return this._getTextareaElem().val(); - }, - - _getTextareaElem: function () { - return this._containerElem.find('textarea'); - }, - - _positionCursor: function (textareaElem, selectText) { - textareaElem.focus(); - var lengh = textareaElem.val().length; - if (selectText) { - // Mark text as selected ... - if (textareaElem.createTextRange) { - var rang = textareaElem.createTextRange(); - rang.select(); - rang.move("character", lengh); - } - else { - textareaElem[0].setSelectionRange(0, lengh); - } - - } else { - // Move the cursor to the last character .. - if (textareaElem.createTextRange) { - var range = textareaElem.createTextRange(); - range.move("character", lengh); - } else { - if (Browser.ie11) { - textareaElem[0].selectionStart = lengh; - textareaElem[0].selectionEnd = lengh; - } else { - textareaElem.selectionStart = lengh; - textareaElem.selectionEnd = lengh; - } - textareaElem.focus(); - } - } - - }, - - close: function (update) { - if (this.isVisible() && this._topic) { - // Update changes ... - clearTimeout(this._timeoutId); - - if (!$defined(update) || update) { - this._updateModel(); - } - - // Let make the visible text in the node visible again ... - this._topic.getTextShape().setVisibility(true); - - // Remove it form the screen ... - this._containerElem.remove(); - this._containerElem = null; - this._timeoutId = -1; - } - this._topic = null; - } -}); - diff --git a/mindplot/src/main/javascript/NodeGraph.js b/mindplot/src/main/javascript/NodeGraph.js deleted file mode 100644 index 1e4f8d63..00000000 --- a/mindplot/src/main/javascript/NodeGraph.js +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.NodeGraph = new Class(/** @lends NodeGraph */{ - /** - * @constructs - * @param {mindplot.model.NodeModel} nodeModel - * @param {Object} options - * @throws will throw an error if nodeModel is null or undefined - */ - initialize: function (nodeModel, options) { - $assert(nodeModel, "model can not be null"); - - this._options = options; - this._mouseEvents = true; - this.setModel(nodeModel); - this._onFocus = false; - this._size = {width: 50, height: 20}; - }, - - /** @return true if option is set to read-only */ - isReadOnly: function () { - return this._options.readOnly; - }, - - /** @return model type */ - getType: function () { - var model = this.getModel(); - return model.getType(); - }, - - /** - * @param {String} id - * @throws will throw an error if the topic id is not a number - */ - setId: function (id) { - $assert(typeof topic.getId() == "number", "id is not a number:" + id); - this.getModel().setId(id); - }, - - _set2DElement: function (elem2d) { - this._elem2d = elem2d; - }, - - /** - * @return 2D element - * @throws will throw an error if the element is null or undefined within node graph - */ - get2DElement: function () { - $assert(this._elem2d, 'NodeGraph has not been initialized properly'); - return this._elem2d; - }, - - /** @abstract */ - setPosition: function (point, fireEvent) { - throw "Unsupported operation"; - }, - - /** */ - addEvent: function (type, listener) { - var elem = this.get2DElement(); - elem.addEvent(type, listener); - }, - - /** */ - removeEvent: function (type, listener) { - var elem = this.get2DElement(); - elem.removeEvent(type, listener); - }, - - /** */ - fireEvent: function (type, event) { - var elem = this.get2DElement(); - elem.trigger(type, event); - }, - - /** */ - setMouseEventsEnabled: function (isEnabled) { - this._mouseEvents = isEnabled; - }, - - /** */ - isMouseEventsEnabled: function () { - return this._mouseEvents; - }, - - /** @return {Object} size*/ - getSize: function () { - return this._size; - }, - - /** @param {Object} size*/ - setSize: function (size) { - this._size.width = parseInt(size.width); - this._size.height = parseInt(size.height); - }, - - /** - * @return {mindplot.model.NodeModel} the node model - */ - getModel: function () { - $assert(this._model, 'Model has not been initialized yet'); - return this._model; - }, - - /** - * @param {mindplot.NodeModel} model the node model - * @throws will throw an error if model is null or undefined - */ - setModel: function (model) { - $assert(model, 'Model can not be null'); - this._model = model; - }, - - /** */ - getId: function () { - return this._model.getId(); - }, - - /** */ - setOnFocus: function (focus) { - if (this._onFocus != focus) { - - this._onFocus = focus; - var outerShape = this.getOuterShape(); - if (focus) { - outerShape.setFill(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES_FOCUS.fillColor); - outerShape.setOpacity(1); - - } else { - outerShape.setFill(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES.fillColor); - outerShape.setOpacity(0); - } - this.setCursor('move'); - - // In any case, always try to hide the editor ... - this.closeEditors(); - - // Fire event ... - this.fireEvent(focus ? 'ontfocus' : 'ontblur', this); - - } - }, - - /** @return {Boolean} true if the node graph is on focus */ - isOnFocus: function () { - return this._onFocus; - }, - - /** */ - dispose: function (workspace) { - this.setOnFocus(false); - workspace.removeChild(this); - }, - - /** */ - createDragNode: function (layoutManager) { - var dragShape = this._buildDragShape(); - return new mindplot.DragTopic(dragShape, this, layoutManager); - }, - - _buildDragShape: function () { - $assert(false, '_buildDragShape must be implemented by all nodes.'); - }, - - /** */ - getPosition: function () { - var model = this.getModel(); - return model.getPosition(); - } -}); - -/** - * creates a new topic from the given node model - * @memberof mindplot.Nodegraph - * @param {mindplot.model.NodeModel} nodeModel - * @param {Object} options - * @throws will throw an error if nodeModel is null or undefined - * @throws will throw an error if the nodeModel's type is null or undefined - * @throws will throw an error if the node type cannot be recognized as either central or main - * topic type - * @return {mindplot.CentralTopic|mindplot.MainTopic} the new topic - */ -mindplot.NodeGraph.create = function (nodeModel, options) { - $assert(nodeModel, 'Model can not be null'); - - var type = nodeModel.getType(); - $assert(type, 'Node model type can not be null'); - - var result; - if (type == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - result = new mindplot.CentralTopic(nodeModel, options); - } else if (type == mindplot.model.INodeModel.MAIN_TOPIC_TYPE) { - result = new mindplot.MainTopic(nodeModel, options); - } else { - $assert(false, "unsupported node type:" + type); - } - - return result; -}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/NoteIcon.js b/mindplot/src/main/javascript/NoteIcon.js deleted file mode 100644 index 07bbd75c..00000000 --- a/mindplot/src/main/javascript/NoteIcon.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.NoteIcon = new Class({ - Extends: mindplot.Icon, - initialize: function (topic, noteModel, readOnly) { - $assert(topic, 'topic can not be null'); - - this.parent(mindplot.NoteIcon.IMAGE_URL); - this._linksModel = noteModel; - this._topic = topic; - this._readOnly = readOnly; - - this._registerEvents(); - }, - - _registerEvents: function () { - this._image.setCursor('pointer'); - var me = this; - - if (!this._readOnly) { - // Add on click event to open the editor ... - this.addEvent('click', function (event) { - me._topic.showNoteEditor(); - event.stopPropagation(); - }); - } - this._tip = new mindplot.widget.FloatingTip($(me.getImage()._peer._native), { - title: $msg('NOTE'), - container: 'body', - // Content can also be a function of the target element! - content: function () { - return me._buildTooltipContent(); - }, - html: true, - placement: 'bottom', - destroyOnExit: true - }); - - }, - - _buildTooltipContent: function () { - if ($("body").find("#textPopoverNote").length == 1) { - var text = $("body").find("#textPopoverNote"); - text.text(this._linksModel.getText()); - } else { - var result = $('
').css({padding: '5px'}); - - var text = $('
').text(this._linksModel.getText()) - .css({ - 'white-space': 'pre-wrap', - 'word-wrap': 'break-word' - } - ); - result.append(text); - return result; - } - }, - - getModel: function () { - return this._linksModel; - } -}); - -mindplot.NoteIcon.IMAGE_URL = "images/notes.png"; - diff --git a/mindplot/src/main/javascript/Options.js b/mindplot/src/main/javascript/Options.js deleted file mode 100644 index a217f2f5..00000000 --- a/mindplot/src/main/javascript/Options.js +++ /dev/null @@ -1,13 +0,0 @@ -Options = new Class({ - - setOptions: function () { - var options = this.options = Object.merge.apply(null, [{}, this.options].append(arguments)); - if (this.addEvent) for (var option in options) { - if (typeOf(options[option]) != 'function' || !(/^on[A-Z]/).test(option)) continue; - this.addEvent(option, options[option]); - delete options[option]; - } - return this; - } - -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/PersistenceManager.js b/mindplot/src/main/javascript/PersistenceManager.js deleted file mode 100644 index 02d39b43..00000000 --- a/mindplot/src/main/javascript/PersistenceManager.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.PersistenceManager = new Class({ - Static: { - loadFromDom: function (mapId, mapDom) { - $assert(mapId, "mapId can not be null"); - $assert(mapDom, "mapDom can not be null"); - - var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(mapDom); - return serializer.loadFromDom(mapDom, mapId); - } - }, - - initialize: function () { - - }, - - save: function (mindmap, editorProperties, saveHistory, events, sync) { - $assert(mindmap, "mindmap can not be null"); - $assert(editorProperties, "editorProperties can not be null"); - - var mapId = mindmap.getId(); - $assert(mapId, "mapId can not be null"); - - var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromMindmap(mindmap); - var domMap = serializer.toXML(mindmap); - var mapXml = core.Utils.innerXML(domMap); - - var pref = JSON.stringify(editorProperties); - try { - this.saveMapXml(mapId, mapXml, pref, saveHistory, events, sync); - } catch (e) { - console.log(e); - events.onError(this._buildError()); - } - }, - - load: function (mapId) { - $assert(mapId, "mapId can not be null"); - var domDocument = this.loadMapDom(mapId); - return mindplot.PersistenceManager.loadFromDom(mapId, domDocument); - }, - - discardChanges: function (mapId) { - throw new Error("Method must be implemented"); - }, - - loadMapDom: function (mapId) { - throw new Error("Method must be implemented"); - }, - - saveMapXml: function (mapId, mapXml, pref, saveHistory, events, sync) { - throw new Error("Method must be implemented"); - }, - - unlockMap: function (mindmap) { - throw new Error("Method must be implemented"); - } -}); - -mindplot.PersistenceManager.init = function (instance) { - mindplot.PersistenceManager._instance = instance; -}; - -mindplot.PersistenceManager.getInstance = function () { - return mindplot.PersistenceManager._instance; -}; - diff --git a/mindplot/src/main/javascript/Relationship.js b/mindplot/src/main/javascript/Relationship.js deleted file mode 100644 index 5de50fbd..00000000 --- a/mindplot/src/main/javascript/Relationship.js +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ -mindplot.Relationship = new Class({ - Extends: mindplot.ConnectionLine, - Static: { - getStrokeColor: function () { - return '#9b74e6'; - }, - type: "Relationship" - }, - initialize: function (sourceNode, targetNode, model) { - $assert(sourceNode, "sourceNode can not be null"); - $assert(targetNode, "targetNode can not be null"); - - this.parent(sourceNode, targetNode, model.getLineType()); - this.setModel(model); - - var strokeColor = mindplot.Relationship.getStrokeColor(); - - this._line2d.setIsSrcControlPointCustom(false); - this._line2d.setIsDestControlPointCustom(false); - this._line2d.setCursor('pointer'); - this._line2d.setStroke(1, 'solid', strokeColor); - this._line2d.setDashed(4, 2); - this._focusShape = this._createLine(this.getLineType(), mindplot.ConnectionLine.SIMPLE_CURVED); - this._focusShape.setStroke(2, "solid", "#3f96ff"); - - var ctrlPoints = this._line2d.getControlPoints(); - this._focusShape.setSrcControlPoint(ctrlPoints[0]); - this._focusShape.setDestControlPoint(ctrlPoints[1]); - this._focusShape.setVisibility(false); - this._onFocus = false; - this._isInWorkspace = false; - this._controlPointsController = new mindplot.ControlPoint(); - - this._startArrow = new web2d.Arrow(); - this._startArrow.setStrokeColor(strokeColor); - this._startArrow.setStrokeWidth(2); - this.setShowStartArrow(true); - - // Share style is disable ... - if (this._showEndArrow) { - this._endArrow = new web2d.Arrow(); - this._endArrow.setStrokeColor(strokeColor); - this._endArrow.setStrokeWidth(2); - } - - // Position the line ... - if ($defined(model.getSrcCtrlPoint())) { - var srcPoint = model.getSrcCtrlPoint().clone(); - this.setSrcControlPoint(srcPoint); - } - if ($defined(model.getDestCtrlPoint())) { - var destPoint = model.getDestCtrlPoint().clone(); - this.setDestControlPoint(destPoint); - } - }, - - setStroke: function (color, style, opacity) { - this.parent(color, style, opacity); - this._startArrow.setStrokeColor(color); - }, - - redraw: function () { - var line2d = this._line2d; - var sourceTopic = this._sourceTopic; - var sourcePosition = sourceTopic.getPosition(); - - var targetTopic = this._targetTopic; - var targetPosition = targetTopic.getPosition(); - if (targetTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - targetPosition = mindplot.util.Shape.workoutIncomingConnectionPoint(targetTopic, sourcePosition); - } - - var sPos, tPos; - this._line2d.setStroke(2); - var ctrlPoints = this._line2d.getControlPoints(); - if (!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()) { - - var defaultPoints = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, targetPosition); - ctrlPoints[0].x = defaultPoints[0].x; - ctrlPoints[0].y = defaultPoints[0].y; - - ctrlPoints[1].x = defaultPoints[1].x; - ctrlPoints[1].y = defaultPoints[1].y; - } - var spoint = new core.Point(); - spoint.x = parseInt(ctrlPoints[0].x) + parseInt(sourcePosition.x); - spoint.y = parseInt(ctrlPoints[0].y) + parseInt(sourcePosition.y); - - var tpoint = new core.Point(); - tpoint.x = parseInt(ctrlPoints[1].x) + parseInt(targetPosition.x); - tpoint.y = parseInt(ctrlPoints[1].y) + parseInt(targetPosition.y); - - sPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(sourceTopic, spoint); - tPos = mindplot.util.Shape.calculateRelationShipPointCoordinates(targetTopic, tpoint); - - line2d.setFrom(sPos.x, sPos.y); - line2d.setTo(tPos.x, tPos.y); - - line2d.moveToFront(); - - //Positionate Arrows - this._positionArrows(); - - // Add connector ... - this._positionateConnector(targetTopic); - - if (this.isOnFocus()) { - this._refreshShape(); - } - this._focusShape.moveToBack(); - this._controlPointsController.redraw(); - }, - - _positionArrows: function () { - var tpos = this._line2d.getTo(); - var spos = this._line2d.getFrom(); - - this._startArrow.setFrom(spos.x, spos.y); - this._startArrow.moveToBack(); - - if (this._endArrow) { - this._endArrow.setFrom(tpos.x, tpos.y); - this._endArrow.moveToBack(); - } - - if (this._line2d.getType() == "CurvedLine") { - var controlPoints = this._line2d.getControlPoints(); - this._startArrow.setControlPoint(controlPoints[0]); - if (this._endArrow) { - this._endArrow.setControlPoint(controlPoints[1]); - } - } else { - this._startArrow.setControlPoint(this._line2d.getTo()); - if (this._endArrow) { - this._endArrow.setControlPoint(this._line2d.getFrom()); - } - } - - if (this._showEndArrow) { - this._endArrow.setVisibility(this.isVisible()); - } - this._startArrow.setVisibility(this.isVisible() && this._showStartArrow); - }, - - addToWorkspace: function (workspace) { - workspace.append(this._focusShape); - workspace.append(this._controlPointsController); - - this._controlPointControllerListener = this._initializeControlPointController.bind(this); - this._line2d.addEvent('click', this._controlPointControllerListener); - this._isInWorkspace = true; - - workspace.append(this._startArrow); - if (this._endArrow) - workspace.append(this._endArrow); - - this.parent(workspace); - this._positionArrows(); - this.redraw(); - - }, - - _initializeControlPointController: function () { - this.setOnFocus(true); - }, - - removeFromWorkspace: function (workspace) { - workspace.removeChild(this._focusShape); - workspace.removeChild(this._controlPointsController); - this._line2d.removeEvent('click', this._controlPointControllerListener); - this._isInWorkspace = false; - workspace.removeChild(this._startArrow); - if (this._endArrow) - workspace.removeChild(this._endArrow); - - this.parent(workspace); - }, - - getType: function () { - return mindplot.Relationship.type; - }, - - setOnFocus: function (focus) { - // Change focus shape - if (this.isOnFocus() != focus) { - if (focus) { - this._refreshShape(); - this._controlPointsController.setLine(this); - } - this._focusShape.setVisibility(focus); - - this._controlPointsController.setVisibility(focus); - this._onFocus = focus; - this.fireEvent(focus ? 'ontfocus' : 'ontblur', this); - } - }, - - _refreshShape: function () { - var sPos = this._line2d.getFrom(); - var tPos = this._line2d.getTo(); - var ctrlPoints = this._line2d.getControlPoints(); - this._focusShape.setFrom(sPos.x, sPos.y); - this._focusShape.setTo(tPos.x, tPos.y); - var shapeCtrlPoints = this._focusShape.getControlPoints(); - shapeCtrlPoints[0].x = ctrlPoints[0].x; - shapeCtrlPoints[0].y = ctrlPoints[0].y; - shapeCtrlPoints[1].x = ctrlPoints[1].x; - shapeCtrlPoints[1].y = ctrlPoints[1].y; - this._focusShape.updateLine(); - }, - - addEvent: function (type, listener) { - // Translate to web 2d events ... - if (type == 'onfocus') { - type = 'mousedown'; - } - - var line = this._line2d; - line.addEvent(type, listener); - }, - - isOnFocus: function () { - return this._onFocus; - }, - - isInWorkspace: function () { - return this._isInWorkspace; - }, - - setVisibility: function (value) { - this.parent(value); - if (this._showEndArrow) - this._endArrow.setVisibility(this._showEndArrow); - this._startArrow.setVisibility(this._showStartArrow && value); - }, - - setOpacity: function (opacity) { - this.parent(opacity); - if (this._showEndArrow) - this._endArrow.setOpacity(opacity); - if (this._showStartArrow) - this._startArrow.setOpacity(opacity); - }, - - setShowEndArrow: function (visible) { - this._showEndArrow = visible; - if (this._isInWorkspace) - this.redraw(); - }, - - setShowStartArrow: function (visible) { - this._showStartArrow = visible; - if (this._isInWorkspace) - this.redraw(); - }, - - setFrom: function (x, y) { - $assert($defined(x), "x must be defined"); - $assert($defined(y), "y must be defined"); - - this._line2d.setFrom(x, y); - this._startArrow.setFrom(x, y); - }, - - setTo: function (x, y) { - $assert($defined(x), "x must be defined"); - $assert($defined(y), "y must be defined"); - - this._line2d.setTo(x, y); - if (this._endArrow) - this._endArrow.setFrom(x, y); - }, - - setSrcControlPoint: function (control) { - this._line2d.setSrcControlPoint(control); - this._startArrow.setControlPoint(control); - }, - - setDestControlPoint: function (control) { - this._line2d.setDestControlPoint(control); - if (this._showEndArrow) - this._endArrow.setControlPoint(control); - }, - - getControlPoints: function () { - return this._line2d.getControlPoints(); - }, - - isSrcControlPointCustom: function () { - return this._line2d.isSrcControlPointCustom(); - }, - - isDestControlPointCustom: function () { - return this._line2d.isDestControlPointCustom(); - }, - - setIsSrcControlPointCustom: function (isCustom) { - this._line2d.setIsSrcControlPointCustom(isCustom); - }, - - setIsDestControlPointCustom: function (isCustom) { - this._line2d.setIsDestControlPointCustom(isCustom); - }, - - getId: function () { - return this._model.getId(); - }, - - fireEvent: function (type, event) { - var elem = this._line2d; - elem.trigger(type, event); - } -}); diff --git a/mindplot/src/main/javascript/RelationshipPivot.js b/mindplot/src/main/javascript/RelationshipPivot.js deleted file mode 100644 index e0106694..00000000 --- a/mindplot/src/main/javascript/RelationshipPivot.js +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.RelationshipPivot = new Class({ - initialize: function (workspace, designer) { - $assert(workspace, "workspace can not be null"); - $assert(designer, "designer can not be null"); - this._workspace = workspace; - this._designer = designer; - - //FIXME: the aim of the migration is remove .bind mootools method, please remove these! - this._mouseMoveEvent = this._mouseMove.bind(this); - this._onClickEvent = this._cleanOnMouseClick.bind(this); - this._onTopicClick = this._connectOnFocus.bind(this); - - }, - - start: function (sourceTopic, targetPos) { - $assert(sourceTopic, "sourceTopic can not be null"); - $assert(targetPos, "targetPos can not be null"); - - this.dispose(); - this._sourceTopic = sourceTopic; - if (sourceTopic != null) { - this._workspace.enableWorkspaceEvents(false); - - var sourcePos = sourceTopic.getPosition(); - var strokeColor = mindplot.Relationship.getStrokeColor(); - - this._pivot = new web2d.CurvedLine(); - this._pivot.setStyle(web2d.CurvedLine.SIMPLE_LINE); - - var fromPos = this._calculateFromPosition(sourcePos); - this._pivot.setFrom(fromPos.x, fromPos.y); - - this._pivot.setTo(targetPos.x, targetPos.y); - this._pivot.setStroke(2, 'solid', strokeColor); - this._pivot.setDashed(4, 2); - - this._startArrow = new web2d.Arrow(); - this._startArrow.setStrokeColor(strokeColor); - this._startArrow.setStrokeWidth(2); - this._startArrow.setFrom(sourcePos.x, sourcePos.y); - - this._workspace.append(this._pivot); - this._workspace.append(this._startArrow); - - this._workspace.addEvent('mousemove', this._mouseMoveEvent); - this._workspace.addEvent('click', this._onClickEvent); - - // Register focus events on all topics ... - var model = this._designer.getModel(); - var topics = model.getTopics(); - _.each(topics, function (topic) { - topic.addEvent('ontfocus', this._onTopicClick); - }.bind(this)); - } - - }, - - dispose: function () { - var workspace = this._workspace; - - if (this._isActive()) { - workspace.removeEvent('mousemove', this._mouseMoveEvent); - workspace.removeEvent('click', this._onClickEvent); - - var model = this._designer.getModel(); - var topics = model.getTopics(); - var me = this; - _.each(topics, function (topic) { - topic.removeEvent('ontfocus', me._onTopicClick); - }); - - workspace.removeChild(this._pivot); - workspace.removeChild(this._startArrow); - workspace.enableWorkspaceEvents(true); - - this._sourceTopic = null; - this._pivot = null; - this._startArrow = null; - } - }, - - _mouseMove: function (event) { - var screen = this._workspace.getScreenManager(); - var pos = screen.getWorkspaceMousePosition(event); - - // Leave the arrow a couple of pixels away from the cursor. - var sourcePosition = this._sourceTopic.getPosition(); - var gapDistance = Math.sign(pos.x - sourcePosition.x) * 5; - - var sPos = this._calculateFromPosition(pos); - this._pivot.setFrom(sPos.x, sPos.y); - - // Update target position ... - this._pivot.setTo(pos.x - gapDistance, pos.y); - - var controlPoints = this._pivot.getControlPoints(); - this._startArrow.setFrom(pos.x - gapDistance, pos.y); - this._startArrow.setControlPoint(controlPoints[1]); - - event.stopPropagation(); - return false; - }, - - _cleanOnMouseClick: function (event) { - - // The user clicks on a desktop on in other element that is not a node. - this.dispose(); - event.stopPropagation(); - }, - - _calculateFromPosition: function (toPosition) { - - // Calculate origin position ... - var sourcePosition = this._sourceTopic.getPosition(); - if (this._sourceTopic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - sourcePosition = mindplot.util.Shape.workoutIncomingConnectionPoint(this._sourceTopic, toPosition); - } - var controlPoint = mindplot.util.Shape.calculateDefaultControlPoints(sourcePosition, toPosition); - - var spoint = new core.Point(); - spoint.x = parseInt(controlPoint[0].x) + parseInt(sourcePosition.x); - spoint.y = parseInt(controlPoint[0].y) + parseInt(sourcePosition.y); - return mindplot.util.Shape.calculateRelationShipPointCoordinates(this._sourceTopic, spoint); - }, - - _connectOnFocus: function (event, targetTopic) { - var sourceTopic = this._sourceTopic; - var mindmap = this._designer.getMindmap(); - - // Avoid circular connections ... - if (targetTopic.getId() != sourceTopic.getId()) { - var relModel = mindmap.createRelationship(targetTopic.getId(), sourceTopic.getId()); - this._designer._actionDispatcher.addRelationship(relModel); - } - this.dispose(); - }, - - _isActive: function () { - return this._pivot != null; - } -}); - diff --git a/mindplot/src/main/javascript/RestPersistenceManager.js b/mindplot/src/main/javascript/RestPersistenceManager.js deleted file mode 100644 index 38b9a8bd..00000000 --- a/mindplot/src/main/javascript/RestPersistenceManager.js +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.RESTPersistenceManager = new Class({ - Extends: mindplot.PersistenceManager, - initialize: function (options) { - this.parent(); - $assert(options.documentUrl, "documentUrl can not be null"); - $assert(options.revertUrl, "revertUrl can not be null"); - $assert(options.lockUrl, "lockUrl can not be null"); - $assert(options.session, "session can not be null"); - $assert(options.timestamp, "timestamp can not be null"); - - this.documentUrl = options.documentUrl; - this.revertUrl = options.revertUrl; - this.lockUrl = options.lockUrl; - this.timestamp = options.timestamp; - this.session = options.session; - }, - - saveMapXml: function (mapId, mapXml, pref, saveHistory, events, sync) { - - var data = { - id: mapId, - xml: mapXml, - properties: pref - }; - - var persistence = this; - var query = "minor=" + !saveHistory; - query = query + "×tamp=" + this.timestamp; - query = query + "&session=" + this.session; - - if (!persistence.onSave) { - - // Mark save in process and fire a event unlocking the save ... - persistence.onSave = true; - persistence.clearTimeout = setTimeout(function () { - persistence.clearTimeout = null; - persistence.onSave = false; - }, 10000); - - $.ajax({ - url: this.documentUrl.replace("{id}", mapId) + "?" + query, - type: 'put', - dataType: "json", - data: JSON.stringify(data), - contentType: "application/json; charset=utf-8", - async: !sync, - - success: function (data, textStatus, jqXHRresponseText) { - persistence.timestamp = data; - events.onSuccess(); - }, - error: function (jqXHR, textStatus, errorThrown) { - events.onError(persistence._buildError()); - }, - complete: function () { - // Clear event timeout ... - if (persistence.clearTimeout) { - clearTimeout(persistence.clearTimeout); - } - persistence.onSave = false; - }, - fail: function (xhr, textStatus) { - - var responseText = xhr.responseText; - var userMsg = {severity: "SEVERE", message: $msg('SAVE_COULD_NOT_BE_COMPLETED')}; - - var contentType = xhr.getResponseHeader("Content-Type"); - if (contentType != null && contentType.indexOf("application/json") != -1) { - var serverMsg = null; - try { - serverMsg = $.parseJSON(responseText); - serverMsg = serverMsg.globalSeverity ? serverMsg : null; - } catch (e) { - // Message could not be decoded ... - } - userMsg = persistence._buildError(serverMsg); - - } else { - if (this.status == 405) { - userMsg = {severity: "SEVERE", message: $msg('SESSION_EXPIRED')}; - } - } - events.onError(userMsg); - persistence.onSave = false; - } - }); - } - }, - - discardChanges: function (mapId) { - $.ajax({ - url: this.revertUrl.replace("{id}", mapId), - async: false, - method: 'post', - headers: {"Content-Type": "application/json; charset=utf-8", "Accept": "application/json"} - }); - }, - - unlockMap: function (mindmap) { - var mapId = mindmap.getId(); - $.ajax({ - url: this.lockUrl.replace("{id}", mapId), - async: false, - method: 'put', - headers: {"Content-Type": "text/plain"}, - data: "false" - }); - }, - - _buildError: function (jsonSeverResponse) { - var message = jsonSeverResponse ? jsonSeverResponse.globalErrors[0] : null; - var severity = jsonSeverResponse ? jsonSeverResponse.globalSeverity : null; - - if (!message) { - message = $msg('SAVE_COULD_NOT_BE_COMPLETED'); - } - - if (!severity) { - severity = "INFO"; - } - return {severity: severity, message: message}; - }, - - loadMapDom: function (mapId) { - // Let's try to open one from the local directory ... - var xml; - $.ajax({ - url: this.documentUrl.replace("{id}", mapId) + "/xml", - method: 'get', - async: false, - headers: {"Content-Type": "text/plain", "Accept": "application/xml"}, - success: function (responseText) { - xml = responseText; - } - }); - - // If I could not load it from a file, hard code one. - if (xml == null) { - throw new Error("Map could not be loaded"); - } - - return xml; - } - } -); diff --git a/mindplot/src/main/javascript/ScreenManager.js b/mindplot/src/main/javascript/ScreenManager.js deleted file mode 100644 index e180b77d..00000000 --- a/mindplot/src/main/javascript/ScreenManager.js +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ScreenManager = new Class({ - initialize: function (divElement) { - $assert(divElement, "can not be null"); - this._divContainer = divElement; - this._padding = {x: 0, y: 0}; - - // Ignore default click event propagation. Prevent 'click' event on drag. - this._clickEvents = []; - this._divContainer.bind('click', function (event) { - event.stopPropagation() - }); - - this._divContainer.bind('dblclick', function (event) { - event.stopPropagation(); - event.preventDefault(); - }); - }, - - setScale: function (scale) { - $assert(scale, 'Screen scale can not be null'); - this._scale = scale; - }, - - addEvent: function (event, listener) { - if (event == 'click') - this._clickEvents.push(listener); - else - this._divContainer.bind(event, listener); - }, - - removeEvent: function (event, listener) { - if (event == 'click') { - this._clickEvents.remove(listener); - } - else { - this._divContainer.unbind(event, listener); - } - }, - - fireEvent: function (type, event) { - if (type == 'click') { - _.each(this._clickEvents, function (listener) { - listener(type, event); - }); - } - else { - this._divContainer.trigger(type, event); - } - }, - - _getElementPosition: function (elem) { - // Retrieve current element position. - var elementPosition = elem.getPosition(); - var x = elementPosition.x; - var y = elementPosition.y; - - // Add workspace offset. - x = x - this._padding.x; - y = y - this._padding.y; - - // Scale coordinate in order to be relative to the workspace. That's coord/size; - x = x / this._scale; - y = y / this._scale; - - // Remove decimal part.. - return {x: x, y: y}; - }, - - getWorkspaceIconPosition: function (e) { - // Retrieve current icon position. - var image = e.getImage(); - var elementPosition = image.getPosition(); - var imageSize = e.getSize(); - - //Add group offset - var iconGroup = e.getGroup(); - var group = iconGroup.getNativeElement(); - var coordOrigin = group.getCoordOrigin(); - var groupSize = group.getSize(); - var coordSize = group.getCoordSize(); - - var scale = {x: coordSize.width / parseInt(groupSize.width), y: coordSize.height / parseInt(groupSize.height)}; - - var x = (elementPosition.x - coordOrigin.x - (parseInt(imageSize.width) / 2)) / scale.x; - var y = (elementPosition.y - coordOrigin.y - (parseInt(imageSize.height) / 2)) / scale.y; - - //Retrieve iconGroup Position - var groupPosition = iconGroup.getPosition(); - x = x + groupPosition.x; - y = y + groupPosition.y; - - //Retrieve topic Position - var topic = iconGroup.getTopic(); - var topicPosition = this._getElementPosition(topic); - topicPosition.x = topicPosition.x - (parseInt(topic.getSize().width) / 2); - - // Remove decimal part.. - return {x: x + topicPosition.x, y: y + topicPosition.y}; - }, - - getWorkspaceMousePosition: function (event) { - // Retrieve current mouse position. - var x = event.clientX; - var y = event.clientY; - - //FIXME: paulo: why? Subtract div position. - /*var containerPosition = this.getContainer().position(); - x = x - containerPosition.x; - y = y - containerPosition.y;*/ - - // Scale coordinate in order to be relative to the workspace. That's coordSize/size; - x = x * this._scale; - y = y * this._scale; - - // Add workspace offset. - x = x + this._padding.x; - y = y + this._padding.y; - - // Remove decimal part.. - return new core.Point(x, y); - }, - - getContainer: function () { - return this._divContainer; - }, - - setOffset: function (x, y) { - this._padding.x = x; - this._padding.y = y; - } -}); diff --git a/mindplot/src/main/javascript/ShrinkConnector.js b/mindplot/src/main/javascript/ShrinkConnector.js deleted file mode 100644 index 8dd59a4f..00000000 --- a/mindplot/src/main/javascript/ShrinkConnector.js +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.ShirinkConnector = new Class({ - initialize: function (topic) { - - var ellipse = new web2d.Elipse(mindplot.Topic.prototype.INNER_RECT_ATTRIBUTES); - this._ellipse = ellipse; - ellipse.setFill('rgb(62,118,179)'); - - ellipse.setSize(mindplot.Topic.CONNECTOR_WIDTH, mindplot.Topic.CONNECTOR_WIDTH); - ellipse.addEvent('click', function (event) { - var model = topic.getModel(); - var collapse = !model.areChildrenShrunken(); - - var topicId = topic.getId(); - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.shrinkBranch([topicId], collapse); - - event.stopPropagation(); - - }); - - ellipse.addEvent('mousedown', function (event) { - // Avoid node creation ... - event.stopPropagation(); - }); - - ellipse.addEvent('dblclick', function (event) { - // Avoid node creation ... - event.stopPropagation(); - }); - - ellipse.addEvent('mouseover', function (event) { - - ellipse.setFill('rgb(153, 0, 255)'); - }); - var me = this; - ellipse.addEvent('mouseout', function (event) { - var color = topic.getBackgroundColor(); - me.setFill(color); - }); - - ellipse.setCursor('default'); - this._fillColor = '#f7f7f7'; - var model = topic.getModel(); - this.changeRender(model.areChildrenShrunken()); - - }, - - changeRender: function (isShrink) { - var elipse = this._ellipse; - if (isShrink) { - elipse.setStroke('2', 'solid'); - } else { - elipse.setStroke('1', 'solid'); - } - }, - - setVisibility: function (value) { - this._ellipse.setVisibility(value); - }, - - setOpacity: function (opacity) { - this._ellipse.setOpacity(opacity); - }, - - setFill: function (color) { - this._fillColor = color; - this._ellipse.setFill(color); - }, - - setAttribute: function (name, value) { - this._ellipse.setAttribute(name, value); - }, - - addToWorkspace: function (group) { - group.append(this._ellipse); - }, - - setPosition: function (x, y) { - this._ellipse.setPosition(x, y); - }, - - moveToBack: function () { - this._ellipse.moveToBack(); - }, - - moveToFront: function () { - this._ellipse.moveToFront(); - } -}); diff --git a/mindplot/src/main/javascript/StandaloneActionDispatcher.js b/mindplot/src/main/javascript/StandaloneActionDispatcher.js deleted file mode 100644 index 1cc0b3e6..00000000 --- a/mindplot/src/main/javascript/StandaloneActionDispatcher.js +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.StandaloneActionDispatcher = new Class(/** @lends StandaloneActionDispatcher */{ - Extends: mindplot.ActionDispatcher, - /** - * @extends mindplot.ActionDispatcher - * @constructs - * @param {mindplot.CommandContext} commandContext - */ - initialize: function (commandContext) { - this.parent(commandContext); - this._actionRunner = new mindplot.DesignerActionRunner(commandContext, this); - }, - - /** */ - addTopics: function (models, parentTopicsId) { - var command = new mindplot.commands.AddTopicCommand(models, parentTopicsId); - this.execute(command); - }, - - /** */ - addRelationship: function (model) { - var command = new mindplot.commands.AddRelationshipCommand(model); - this.execute(command); - }, - - /** */ - deleteEntities: function (topicsIds, relIds) { - var command = new mindplot.commands.DeleteCommand(topicsIds, relIds); - this.execute(command); - }, - - /** */ - dragTopic: function (topicId, position, order, parentTopic) { - var command = new mindplot.commands.DragTopicCommand(topicId, position, order, parentTopic); - this.execute(command); - }, - - /** */ - moveTopic: function (topicId, position) { - $assert($defined(topicId), "topicsId can not be null"); - $assert($defined(position), "position can not be null"); - - var commandFunc = function (topic, value) { - var result = topic.getPosition(); - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeMoveEvent, { - node: topic.getModel(), - position: value - }); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicId, position); - this.execute(command); - }, - - /** */ - moveControlPoint: function (ctrlPoint, point) { - var command = new mindplot.commands.MoveControlPointCommand(ctrlPoint, point); - this.execute(command); - }, - - /** */ - changeFontStyleToTopic: function (topicsIds) { - - var commandFunc = function (topic) { - var result = topic.getFontStyle(); - var style = (result == "italic") ? "normal" : "italic"; - topic.setFontStyle(style, true); - return result; - }; - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds); - this.execute(command); - - }, - - /** */ - changeTextToTopic: function (topicsIds, text) { - $assert($defined(topicsIds), "topicsIds can not be null"); - - var commandFunc = function (topic, value) { - var result = topic.getText(); - topic.setText(value); - return result; - }; - commandFunc.commandType = "changeTextToTopic"; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, text); - this.execute(command); - }, - - /** */ - changeFontFamilyToTopic: function (topicIds, fontFamily) { - $assert(topicIds, "topicIds can not be null"); - $assert(fontFamily, "fontFamily can not be null"); - - - var commandFunc = function (topic, fontFamily) { - var result = topic.getFontFamily(); - topic.setFontFamily(fontFamily, true); - - topic._adjustShapes(); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicIds, fontFamily); - this.execute(command); - }, - - /** */ - changeFontColorToTopic: function (topicsIds, color) { - $assert(topicsIds, "topicIds can not be null"); - $assert(color, "color can not be null"); - - var commandFunc = function (topic, color) { - var result = topic.getFontColor(); - topic.setFontColor(color, true); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = "fontColorCommandId"; - this.execute(command); - }, - - /** */ - changeBackgroundColorToTopic: function (topicsIds, color) { - $assert(topicsIds, "topicIds can not be null"); - $assert(color, "color can not be null"); - - var commandFunc = function (topic, color) { - var result = topic.getBackgroundColor(); - topic.setBackgroundColor(color); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = "backColor"; - this.execute(command); - }, - - /** */ - changeBorderColorToTopic: function (topicsIds, color) { - $assert(topicsIds, "topicIds can not be null"); - $assert(color, "topicIds can not be null"); - - var commandFunc = function (topic, color) { - var result = topic.getBorderColor(); - topic.setBorderColor(color); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, color); - command.discardDuplicated = "borderColorCommandId"; - this.execute(command); - }, - - /** */ - changeFontSizeToTopic: function (topicsIds, size) { - $assert(topicsIds, "topicIds can not be null"); - $assert(size, "size can not be null"); - - var commandFunc = function (topic, size) { - var result = topic.getFontSize(); - topic.setFontSize(size, true); - - topic._adjustShapes(); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, size); - this.execute(command); - }, - - /** */ - changeShapeTypeToTopic: function (topicsIds, shapeType) { - $assert(topicsIds, "topicsIds can not be null"); - $assert(shapeType, "shapeType can not be null"); - - var commandFunc = function (topic, shapeType) { - var result = topic.getShapeType(); - topic.setShapeType(shapeType, true); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, shapeType); - this.execute(command); - }, - - /** */ - changeFontWeightToTopic: function (topicsIds) { - $assert(topicsIds, "topicsIds can not be null"); - - var commandFunc = function (topic) { - var result = topic.getFontWeight(); - var weight = (result == "bold") ? "normal" : "bold"; - topic.setFontWeight(weight, true); - - topic._adjustShapes(); - return result; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds); - this.execute(command); - }, - - /** */ - shrinkBranch: function (topicsIds, collapse) { - $assert(topicsIds, "topicsIds can not be null"); - - var commandFunc = function (topic, isShrink) { - topic.setChildrenShrunken(isShrink); - return !isShrink; - }; - - var command = new mindplot.commands.GenericFunctionCommand(commandFunc, topicsIds, collapse); - this.execute(command, false); - }, - - /** */ - addFeatureToTopic: function (topicId, featureType, attributes) { - var command = new mindplot.commands.AddFeatureToTopicCommand(topicId, featureType, attributes); - this.execute(command); - }, - - /** */ - changeFeatureToTopic: function (topicId, featureId, attributes) { - var command = new mindplot.commands.ChangeFeatureToTopicCommand(topicId, featureId, attributes); - this.execute(command); - }, - - /** */ - removeFeatureFromTopic: function (topicId, featureId) { - var command = new mindplot.commands.RemoveFeatureFromTopicCommand(topicId, featureId); - this.execute(command); - }, - - /** */ - execute: function (command) { - this._actionRunner.execute(command); - } - -}); - -mindplot.CommandContext = new Class(/** @lends CommandContext */{ - /** - * @constructs - * @param {mindplot.Designer} designer - */ - initialize: function (designer) { - $assert(designer, "designer can not be null"); - this._designer = designer; - }, - - /** */ - findTopics: function (topicsIds) { - $assert($defined(topicsIds), "topicsIds can not be null"); - if (!(topicsIds instanceof Array)) { - topicsIds = [topicsIds]; - } - - var designerTopics = this._designer.getModel().getTopics(); - var result = designerTopics.filter(function (topic) { - return topicsIds.contains(topic.getId()); - }); - - if (result.length != topicsIds.length) { - var ids = designerTopics.map(function (topic) { - return topic.getId(); - }); - $assert(result.length == topicsIds.length, "Could not find topic. Result:" + result + ", Filter Criteria:" + topicsIds + ", Current Topics: [" + ids + "]"); - } - return result; - }, - - /** */ - deleteTopic: function (topic) { - this._designer.removeTopic(topic); - }, - - /** */ - createTopic: function (model) { - $assert(model, "model can not be null"); - return this._designer.nodeModelToNodeGraph(model); - }, - - /** */ - createModel: function () { - var mindmap = this._designer.getMindmap(); - return mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE); - }, - - /** */ - addTopic: function (topic) { - var mindmap = this._designer.getMindmap(); - return mindmap.addBranch(topic.getModel()); - }, - - /** */ - connect: function (childTopic, parentTopic) { - childTopic.connectTo(parentTopic, this._designer._workspace); - }, - - /** */ - disconnect: function (topic) { - topic.disconnect(this._designer._workspace); - }, - - /** */ - addRelationship: function (model) { - $assert(model, "model cannot be null"); - return this._designer.addRelationship(model); - }, - - /** */ - deleteRelationship: function (relationship) { - this._designer.deleteRelationship(relationship); - }, - - /** */ - findRelationships: function (relIds) { - $assert($defined(relIds), "relId can not be null"); - if (!(relIds instanceof Array)) { - relIds = [relIds]; - } - - var designerRel = this._designer.getModel().getRelationships(); - return designerRel.filter(function (rel) { - return relIds.contains(rel.getId()); - }); - }, - - /** */ - moveTopic: function (topic, position) { - $assert(topic, "topic cannot be null"); - $assert(position, "position cannot be null"); - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeMoveEvent, { - node: topic.getModel(), - position: position - }); - } -}); - - diff --git a/mindplot/src/main/javascript/TextEditor.js b/mindplot/src/main/javascript/TextEditor.js deleted file mode 100644 index 00a0a974..00000000 --- a/mindplot/src/main/javascript/TextEditor.js +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -//FIXME: Not used! -mindplot.TextEditor = new Class({ - initialize: function (topic) { - this._topic = topic; - }, - - _buildEditor: function () { - - this._size = {width: 500, height: 100}; - var result = new Element('div'); - result.setStyles({ - position: "absolute", - display: "none", - zIndex: "8", - width: "500px", - height: "100px" - } - ); - - - var inputContainer = new Element('div'); - inputContainer.setStyles({ - border: "none", - overflow: "auto" - }); - inputContainer.inject(result); - - var inputText = new Element('input', - { - type: "text", - tabindex: '-1', - value: "" - } - ); - inputText.setStyles({ - border: "none", - background: "transparent" - }); - inputText.inject(inputContainer); - - var spanContainer = new Element('div'); - spanContainer.setStyle('visibility', "hidden"); - spanContainer.inject(result); - - var spanElem = new Element('span', {tabindex: "-1"}); - spanElem.setStyle('white-space', "nowrap"); - spanElem.setStyle('nowrap', 'nowrap'); - spanElem.inject(spanContainer); - - - return result; - }, - - _registerEvents: function (divElem) { - var inputElem = this._getTextareaElem(); - var spanElem = this._getSpanElem(); - var me = this; - - divElem.addEvent('keydown', function (event) { - switch (event.key) { - case 'esc': - me.close(false); - break; - case 'enter': - me.close(true); - break; - default: - spanElem.innerHTML = inputElem.value; - var size = inputElem.value.length + 1; - inputElem.size = size; - if (spanElem.offsetWidth > (parseInt(divElem.style.width) - 100)) { - divElem.style.width = (spanElem.offsetWidth + 100) + "px"; - } - break; - } - event.stopPropagation(); - }); - - // If the user clicks on the input, all event must be ignored ... - divElem.addEvent('click', function (event) { - event.stopPropagation(); - }); - divElem.addEvent('dblclick', function (event) { - event.stopPropagation(); - }); - divElem.addEvent('mousedown', function (event) { - event.stopPropagation(); - }); - }, - - isVisible: function () { - return $defined(this._containerElem) && this._containerElem.getStyle('display') == 'block'; - }, - - _updateModel: function () { - - if (this._topic.getText() != this._getText()) { - var text = this._getText(); - var topicId = this._topic.getId(); - - var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.changeTextToTopic([topicId], text); - } - }, - - show: function (text) { - - if (!this.isVisible()) { - //Create editor ui - var editorElem = this._buildEditor(); - editorElem.inject($(document.body)[0]); - - this._containerElem = editorElem; - this._registerEvents(editorElem); - this._showEditor(text); - } - }, - - _showEditor: function (defaultText) { - - var topic = this._topic; - - // Hide topic text ... - topic.getTextShape().setVisibility(false); - - // Set Editor Style - var nodeText = topic.getTextShape(); - var font = nodeText.getFont(); - font.size = nodeText.getHtmlFontSize(); - font.color = nodeText.getColor(); - this._setStyle(font); - - // Set editor's initial text - var text = $defined(defaultText) ? defaultText : topic.getText(); - this._setText(text); - - var me = this; - // Set editor's initial size - var displayFunc = function () { - // Position the editor and set the size... - var textShape = me._topic.getTextShape(); - - me._containerElem.css('display', 'block'); - - me._containerElem.offset(textShape.getNativePosition()); - // Set size ... - var elemSize = topic.getSize(); - me._setEditorSize(elemSize.width, elemSize.height); - - var textareaElem = me._getTextareaElem(); - textareaElem.focus(); - me._positionCursor(textareaElem, !$defined(defaultText)); - - }; - - displayFunc.delay(10); - }, - - _setStyle: function (fontStyle) { - var inputField = this._getTextareaElem(); - var spanField = this._getSpanElem(); - if (!$defined(fontStyle.font)) { - fontStyle.font = "Arial"; - } - if (!$defined(fontStyle.style)) { - fontStyle.style = "normal"; - } - if (!$defined(fontStyle.weight)) { - fontStyle.weight = "normal"; - } - if (!$defined(fontStyle.size)) { - fontStyle.size = 12; - } - inputField.style.fontSize = fontStyle.size + "px"; - inputField.style.fontFamily = fontStyle.font; - inputField.style.fontStyle = fontStyle.style; - inputField.style.fontWeight = fontStyle.weight; - inputField.style.color = fontStyle.color; - spanField.style.fontFamily = fontStyle.font; - spanField.style.fontStyle = fontStyle.style; - spanField.style.fontWeight = fontStyle.weight; - spanField.style.fontSize = fontStyle.size + "px"; - }, - - _setText: function (text) { - var inputField = this._getTextareaElem(); - inputField.size = text.length + 1; - this._containerElem.style.width = (inputField.size * parseInt(inputField.style.fontSize) + 100) + "px"; - var spanField = this._getSpanElem(); - spanField.innerHTML = text; - inputField.value = text; - }, - - _getText: function () { - return this._getTextareaElem().value; - }, - - _getTextareaElem: function () { - return this._containerElem.getElement('input'); - }, - - _getSpanElem: function () { - return this._containerElem.getElement('span'); - }, - - _setEditorSize: function (width, height) { - var textShape = this._topic.getTextShape(); - var scale = web2d.peer.utils.TransformUtil.workoutScale(textShape._peer); - this._size = {width: width * scale.width, height: height * scale.height}; - this._containerElem.style.width = this._size.width * 2 + "px"; - this._containerElem.style.height = this._size.height + "px"; - }, - - _positionCursor: function (inputElem, selectText) { - // Select text if it's required ... - if (inputElem.createTextRange) //ie - { - var range = inputElem.createTextRange(); - var pos = inputElem.value.length; - if (!selectText) { - range.select(); - range.move("character", pos); - } - else { - range.move("character", pos); - range.select(); - } - } - else if (!selectText) { - inputElem.setSelectionRange(0, inputElem.value.length); - } - }, - - close: function (update) { - if (this.isVisible()) { - // Update changes ... - if (!$defined(update) || update) { - this._updateModel(); - } - - // Let make the visible text in the node visible again ... - this._topic.getTextShape().setVisibility(true); - - // Remove it form the screen ... - this._containerElem.dispose(); - this._containerElem = null; - } - } -}); - diff --git a/mindplot/src/main/javascript/TextEditorFactory.js b/mindplot/src/main/javascript/TextEditorFactory.js deleted file mode 100644 index 5899fb79..00000000 --- a/mindplot/src/main/javascript/TextEditorFactory.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ -mindplot.TextEditorFactory = {}; - -mindplot.TextEditorFactory.getTextEditorFromName = function (name) { - var editorClass = null; - if (name == "RichTextEditor") { - editorClass = mindplot.RichTextEditor; - } else { - editorClass = mindplot.TextEditor; - } - return editorClass; -}; \ No newline at end of file diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js deleted file mode 100644 index 65db1002..00000000 --- a/mindplot/src/main/javascript/Topic.js +++ /dev/null @@ -1,1356 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Topic = new Class(/** @lends Topic */{ - Extends: mindplot.NodeGraph, - /** - * @extends mindplot.NodeGraph - * @constructs - * @param model - * @param options - */ - initialize: function (model, options) { - this.parent(model, options); - this._children = []; - this._parent = null; - this._relationships = []; - this._isInWorkspace = false; - this._buildTopicShape(); - - // Position a topic .... - var pos = model.getPosition(); - if (pos != null && this.isCentralTopic()) { - this.setPosition(pos); - } - - // Register events for the topic ... - if (!this.isReadOnly()) { - this._registerEvents(); - } - }, - - _registerEvents: function () { - - this.setMouseEventsEnabled(true); - - // Prevent click on the topics being propagated ... - this.addEvent('click', function (event) { - event.stopPropagation(); - }); - var me = this; - this.addEvent('dblclick', function (event) { - me._getTopicEventDispatcher().show(me); - event.stopPropagation(); - }); - }, - - /** - * @param {String} type the topic shape type - * @see {@link mindplot.model.INodeModel} - */ - setShapeType: function (type) { - this._setShapeType(type, true); - }, - - /** @return {mindplot.Topic} parent topic */ - getParent: function () { - return this._parent; - }, - - _setShapeType: function (type, updateModel) { - // Remove inner shape figure ... - var model = this.getModel(); - if ($defined(updateModel) && updateModel) { - model.setShapeType(type); - } - - var oldInnerShape = this.getInnerShape(); - if (oldInnerShape != null) { - - this._removeInnerShape(); - - // Create a new one ... - var innerShape = this.getInnerShape(); - - // Update figure size ... - var size = this.getSize(); - this.setSize(size, true); - - var group = this.get2DElement(); - group.append(innerShape); - - // Move text to the front ... - var text = this.getTextShape(); - text.moveToFront(); - - //Move iconGroup to front ... - var iconGroup = this.getIconGroup(); - if ($defined(iconGroup)) { - iconGroup.moveToFront(); - } - - //Move connector to front - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.moveToFront(); - } - } - - }, - - /** @return {String} topic shape type */ - getShapeType: function () { - var model = this.getModel(); - var result = model.getShapeType(); - if (!$defined(result)) { - result = mindplot.TopicStyle.defaultShapeType(this); - } - return result; - }, - - _removeInnerShape: function () { - var group = this.get2DElement(); - var innerShape = this.getInnerShape(); - group.removeChild(innerShape); - this._innerShape = null; - return innerShape; - }, - - /** @return {web2d.Line|web2d.Rect|web2d.Image} inner shape of the topic */ - getInnerShape: function () { - if (!$defined(this._innerShape)) { - // Create inner box. - this._innerShape = this._buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES, this.getShapeType()); - - // Update bgcolor ... - var bgColor = this.getBackgroundColor(); - this._setBackgroundColor(bgColor, false); - - // Update border color ... - var brColor = this.getBorderColor(); - this._setBorderColor(brColor, false); - - // Define the pointer ... - if (!this.isCentralTopic() && !this.isReadOnly()) { - this._innerShape.setCursor('move'); - } else { - this._innerShape.setCursor('default'); - } - - } - return this._innerShape; - }, - - _buildShape: function (attributes, shapeType) { - $assert(attributes, "attributes can not be null"); - $assert(shapeType, "shapeType can not be null"); - - var result; - if (shapeType == mindplot.model.TopicShape.RECTANGLE) { - result = new web2d.Rect(0, attributes); - } else if (shapeType == mindplot.model.TopicShape.IMAGE) { - var model = this.getModel(); - var url = model.getImageUrl(); - var size = model.getImageSize(); - - result = new web2d.Image(); - result.setHref(url); - result.setSize(size.width, size.height); - - result.getSize = function () { - return model.getImageSize(); - }; - - result.setPosition = function () { - }; - } - else if (shapeType == mindplot.model.TopicShape.ELLIPSE) { - result = new web2d.Rect(0.9, attributes); - } - else if (shapeType == mindplot.model.TopicShape.ROUNDED_RECT) { - result = new web2d.Rect(0.3, attributes); - } - else if (shapeType == mindplot.model.TopicShape.LINE) { - result = new web2d.Line({strokeColor: "#495879", strokeWidth: 1}); - result.setSize = function (width, height) { - this.size = {width: width, height: height}; - result.setFrom(0, height); - result.setTo(width, height); - - // Lines will have the same color of the default connection lines... - var stokeColor = mindplot.ConnectionLine.getStrokeColor(); - result.setStroke(1, 'solid', stokeColor); - }; - - result.getSize = function () { - return this.size; - }; - - result.setPosition = function () { - }; - - result.setFill = function () { - - }; - - result.setStroke = function () { - - }; - } - else { - $assert(false, "Unsupported figure shapeType:" + shapeType); - } - result.setPosition(0, 0); - return result; - }, - - /** @param {String} type the cursor type, either 'pointer', 'default' or 'move' */ - setCursor: function (type) { - var innerShape = this.getInnerShape(); - innerShape.setCursor(type); - - var outerShape = this.getOuterShape(); - outerShape.setCursor(type); - - var textShape = this.getTextShape(); - textShape.setCursor(type); - }, - - /** @return outer shape */ - getOuterShape: function () { - if (!$defined(this._outerShape)) { - var rect = this._buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT); - rect.setPosition(-2, -3); - rect.setOpacity(0); - this._outerShape = rect; - } - - return this._outerShape; - }, - - /** @return text shape */ - getTextShape: function () { - if (!$defined(this._text)) { - this._text = this._buildTextShape(false); - - // Set Text ... - var text = this.getText(); - this._setText(text, false); - } - - return this._text; - }, - - /** @return icon group */ - getOrBuildIconGroup: function () { - if (!$defined(this._iconsGroup)) { - this._iconsGroup = this._buildIconGroup(); - var group = this.get2DElement(); - group.append(this._iconsGroup.getNativeElement()); - this._iconsGroup.moveToFront(); - } - return this._iconsGroup; - }, - - /** */ - getIconGroup: function () { - return this._iconsGroup; - }, - - _buildIconGroup: function () { - var textHeight = this.getTextShape().getFontHeight(); - var result = new mindplot.IconGroup(this.getId(), textHeight); - var padding = mindplot.TopicStyle.getInnerPadding(this); - result.setPosition(padding, padding); - - // Load topic features ... - var model = this.getModel(); - var featuresModel = model.getFeatures(); - for (var i = 0; i < featuresModel.length; i++) { - var featureModel = featuresModel[i]; - var icon = mindplot.TopicFeature.createIcon(this, featureModel, this.isReadOnly()); - result.addIcon(icon, featureModel.getType() == mindplot.TopicFeature.Icon.id && !this.isReadOnly()); - } - - return result; - }, - - /** - * assigns the new feature model to the topic's node model and adds the respective icon - * @param {mindplot.model.FeatureModel} featureModel - * @return {mindplot.Icon} the icon corresponding to the feature model - */ - addFeature: function (featureModel) { - var iconGroup = this.getOrBuildIconGroup(); - this.closeEditors(); - - // Update model ... - var model = this.getModel(); - model.addFeature(featureModel); - - var result = mindplot.TopicFeature.createIcon(this, featureModel, this.isReadOnly()); - iconGroup.addIcon(result, featureModel.getType() == mindplot.TopicFeature.Icon.id && !this.isReadOnly()); - - this._adjustShapes(); - return result; - }, - - /** */ - findFeatureById: function (id) { - var model = this.getModel(); - return model.findFeatureById(id); - }, - - /** */ - removeFeature: function (featureModel) { - $assert(featureModel, "featureModel could not be null"); - - //Removing the icon from MODEL - var model = this.getModel(); - model.removeFeature(featureModel); - - //Removing the icon from UI - var iconGroup = this.getIconGroup(); - if ($defined(iconGroup)) { - iconGroup.removeIconByModel(featureModel); - } - this._adjustShapes(); - }, - - /** */ - addRelationship: function (relationship) { - this._relationships.push(relationship); - }, - - /** */ - deleteRelationship: function (relationship) { - this._relationships.erase(relationship); - }, - - /** */ - getRelationships: function () { - return this._relationships; - }, - - _buildTextShape: function (readOnly) { - var result = new web2d.Text(); - var family = this.getFontFamily(); - var size = this.getFontSize(); - var weight = this.getFontWeight(); - var style = this.getFontStyle(); - result.setFont(family, size, style, weight); - - var color = this.getFontColor(); - result.setColor(color); - - if (!readOnly) { - // Propagate mouse events ... - if (!this.isCentralTopic()) { - result.setCursor('move'); - } else { - result.setCursor('default'); - } - } - - return result; - }, - - /** */ - setFontFamily: function (value, updateModel) { - var textShape = this.getTextShape(); - textShape.setFontFamily(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontFamily(value); - } - this._adjustShapes(updateModel); - }, - - /** */ - setFontSize: function (value, updateModel) { - - var textShape = this.getTextShape(); - textShape.setSize(value); - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontSize(value); - } - this._adjustShapes(updateModel); - - }, - - /** */ - setFontStyle: function (value, updateModel) { - var textShape = this.getTextShape(); - textShape.setStyle(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontStyle(value); - } - this._adjustShapes(updateModel); - }, - - /** */ - setFontWeight: function (value, updateModel) { - var textShape = this.getTextShape(); - textShape.setWeight(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontWeight(value); - } - this._adjustShapes(); - }, - - /** */ - getFontWeight: function () { - var model = this.getModel(); - var result = model.getFontWeight(); - if (!$defined(result)) { - var font = mindplot.TopicStyle.defaultFontStyle(this); - result = font.weight; - } - return result; - }, - - /** */ - getFontFamily: function () { - var model = this.getModel(); - var result = model.getFontFamily(); - if (!$defined(result)) { - var font = mindplot.TopicStyle.defaultFontStyle(this); - result = font.font; - } - return result; - }, - - /** */ - getFontColor: function () { - var model = this.getModel(); - var result = model.getFontColor(); - if (!$defined(result)) { - var font = mindplot.TopicStyle.defaultFontStyle(this); - result = font.color; - } - return result; - }, - - /** */ - getFontStyle: function () { - var model = this.getModel(); - var result = model.getFontStyle(); - if (!$defined(result)) { - var font = mindplot.TopicStyle.defaultFontStyle(this); - result = font.style; - } - return result; - }, - - /** */ - getFontSize: function () { - var model = this.getModel(); - var result = model.getFontSize(); - if (!$defined(result)) { - var font = mindplot.TopicStyle.defaultFontStyle(this); - result = font.size; - } - return result; - }, - - /** */ - setFontColor: function (value, updateModel) { - var textShape = this.getTextShape(); - textShape.setColor(value); - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setFontColor(value); - } - }, - - _setText: function (text, updateModel) { - var textShape = this.getTextShape(); - textShape.setText(text == null ? mindplot.TopicStyle.defaultText(this) : text); - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setText(text); - } - }, - - /** */ - setText: function (text) { - // Avoid empty nodes ... - if (!text || $.trim(text).length == 0) { - text = null; - } - - this._setText(text, true); - this._adjustShapes(); - }, - - /** */ - getText: function () { - var model = this.getModel(); - var result = model.getText(); - if (!$defined(result)) { - result = mindplot.TopicStyle.defaultText(this); - } - return result; - }, - - /** */ - setBackgroundColor: function (color) { - this._setBackgroundColor(color, true); - }, - - _setBackgroundColor: function (color, updateModel) { - var innerShape = this.getInnerShape(); - innerShape.setFill(color); - - var connector = this.getShrinkConnector(); - if (connector) { - connector.setFill(color); - } - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setBackgroundColor(color); - } - }, - - /** */ - getBackgroundColor: function () { - var model = this.getModel(); - var result = model.getBackgroundColor(); - if (!$defined(result)) { - result = mindplot.TopicStyle.defaultBackgroundColor(this); - } - return result; - }, - - /** */ - setBorderColor: function (color) { - this._setBorderColor(color, true); - }, - - _setBorderColor: function (color, updateModel) { - var innerShape = this.getInnerShape(); - innerShape.setAttribute('strokeColor', color); - - var connector = this.getShrinkConnector(); - if (connector) { - connector.setAttribute('strokeColor', color); - } - - if ($defined(updateModel) && updateModel) { - var model = this.getModel(); - model.setBorderColor(color); - } - }, - - /** */ - getBorderColor: function () { - var model = this.getModel(); - var result = model.getBorderColor(); - if (!$defined(result)) { - result = mindplot.TopicStyle.defaultBorderColor(this); - } - return result; - }, - - _buildTopicShape: function () { - var groupAttributes = {width: 100, height: 100, coordSizeWidth: 100, coordSizeHeight: 100}; - var group = new web2d.Group(groupAttributes); - this._set2DElement(group); - - // Shape must be build based on the model width ... - var outerShape = this.getOuterShape(); - var innerShape = this.getInnerShape(); - var textShape = this.getTextShape(); - - // Add to the group ... - group.append(outerShape); - group.append(innerShape); - group.append(textShape); - - // Update figure size ... - var model = this.getModel(); - if (model.getFeatures().length != 0) { - this.getOrBuildIconGroup(); - } - - var shrinkConnector = this.getShrinkConnector(); - if ($defined(shrinkConnector)) { - shrinkConnector.addToWorkspace(group); - } - - // Register listeners ... - this._registerDefaultListenersToElement(group, this); - }, - - _registerDefaultListenersToElement: function (elem, topic) { - var mouseOver = function (event) { - if (topic.isMouseEventsEnabled()) { - topic.handleMouseOver(event); - } - }; - elem.addEvent('mouseover', mouseOver); - - var outout = function (event) { - if (topic.isMouseEventsEnabled()) { - topic.handleMouseOut(event); - } - }; - elem.addEvent('mouseout', outout); - - var me = this; - // Focus events ... - elem.addEvent('mousedown', function (event) { - if (!me.isReadOnly()) { - // Disable topic selection of readOnly mode ... - var value = true; - if ((event.metaKey && Browser.Platform.mac) || (event.ctrlKey && !Browser.Platform.mac)) { - value = !me.isOnFocus(); - event.stopPropagation(); - event.preventDefault(); - } - topic.setOnFocus(value); - } - - var eventDispatcher = me._getTopicEventDispatcher(); - eventDispatcher.process(mindplot.TopicEvent.CLICK, me); - event.stopPropagation(); - - }); - }, - - /** */ - areChildrenShrunken: function () { - var model = this.getModel(); - return model.areChildrenShrunken() && !this.isCentralTopic(); - }, - - /** */ - isCollapsed: function () { - var result = false; - - var current = this.getParent(); - while (current && !result) { - result = current.areChildrenShrunken(); - current = current.getParent(); - } - return result; - }, - - /** */ - setChildrenShrunken: function (value) { - // Update Model ... - var model = this.getModel(); - model.setChildrenShrunken(value); - - // Change render base on the state. - var shrinkConnector = this.getShrinkConnector(); - if ($defined(shrinkConnector)) { - shrinkConnector.changeRender(value); - } - - // Do some fancy animation .... - var elements = this._flatten2DElements(this); - var fade = new mindplot.util.FadeEffect(elements, !value); - var me = this; - fade.addEvent('complete', function () { - // Set focus on the parent node ... - if (value) { - me.setOnFocus(true); - } - - // Set focus in false for all the children ... - elements.forEach(function (elem) { - if (elem.setOnFocus) { - elem.setOnFocus(false); - } - }); - }); - fade.start(); - - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model); - - }, - - /** */ - getShrinkConnector: function () { - var result = this._connector; - if (this._connector == null) { - this._connector = new mindplot.ShirinkConnector(this); - this._connector.setVisibility(false); - result = this._connector; - - } - return result; - }, - - /** */ - handleMouseOver: function () { - var outerShape = this.getOuterShape(); - outerShape.setOpacity(1); - }, - - /** */ - handleMouseOut: function () { - var outerShape = this.getOuterShape(); - if (!this.isOnFocus()) { - outerShape.setOpacity(0); - } - }, - - /** */ - showTextEditor: function (text) { - this._getTopicEventDispatcher().show(this, {text: text}); - }, - - /** */ - showNoteEditor: function () { - - var topicId = this.getId(); - var model = this.getModel(); - var editorModel = { - getValue: function () { - var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); - var result; - if (notes.length > 0) - result = notes[0].getText(); - - return result; - }, - - setValue: function (value) { - var dispatcher = mindplot.ActionDispatcher.getInstance(); - var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); - if (!$defined(value)) { - var featureId = notes[0].getId(); - dispatcher.removeFeatureFromTopic(topicId, featureId); - } - else { - if (notes.length > 0) { - dispatcher.changeFeatureToTopic(topicId, notes[0].getId(), {text: value}); - } - else { - dispatcher.addFeatureToTopic(topicId, mindplot.TopicFeature.Note.id, {text: value}); - } - } - } - }; - var editor = new mindplot.widget.NoteEditor(editorModel); - this.closeEditors(); - editor.show(); - }, - - /** opens a dialog where the user can enter or edit an existing link associated with this topic */ - showLinkEditor: function () { - - var topicId = this.getId(); - var model = this.getModel(); - var editorModel = { - getValue: function () { - //@param {mindplot.model.LinkModel[]} links - var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); - var result; - if (links.length > 0) - result = links[0].getUrl(); - - return result; - }, - - setValue: function (value) { - var dispatcher = mindplot.ActionDispatcher.getInstance(); - var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); - if (!$defined(value)) { - var featureId = links[0].getId(); - dispatcher.removeFeatureFromTopic(topicId, featureId); - } - else { - if (links.length > 0) { - dispatcher.changeFeatureToTopic(topicId, links[0].getId(), {url: value}); - } - else { - dispatcher.addFeatureToTopic(topicId, mindplot.TopicFeature.Link.id, {url: value}); - } - } - } - }; - - this.closeEditors(); - var editor = new mindplot.widget.LinkEditor(editorModel); - editor.show(); - }, - - /** */ - closeEditors: function () { - this._getTopicEventDispatcher().close(true); - }, - - _getTopicEventDispatcher: function () { - return mindplot.TopicEventDispatcher.getInstance(); - }, - - /** - * Point: references the center of the rect shape.!!! - */ - setPosition: function (point) { - $assert(point, "position can not be null"); - point.x = Math.ceil(point.x); - point.y = Math.ceil(point.y); - - // Update model's position ... - var model = this.getModel(); - model.setPosition(point.x, point.y); - - // Elements are positioned in the center. - // All topic element must be positioned based on the innerShape. - var size = this.getSize(); - - var cx = point.x - (size.width / 2); - var cy = point.y - (size.height / 2); - - // Update visual position. - this._elem2d.setPosition(cx, cy); - - // Update connection lines ... - this._updateConnectionLines(); - - // Check object state. - this.invariant(); - }, - - /** */ - getOutgoingLine: function () { - return this._outgoingLine; - }, - - /** */ - getIncomingLines: function () { - var result = []; - var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var node = children[i]; - var line = node.getOutgoingLine(); - if ($defined(line)) { - result.push(line); - } - } - return result; - }, - - /** */ - getOutgoingConnectedTopic: function () { - var result = null; - var line = this.getOutgoingLine(); - if ($defined(line)) { - result = line.getTargetTopic(); - } - return result; - }, - - _updateConnectionLines: function () { - // Update this to parent line ... - var outgoingLine = this.getOutgoingLine(); - if ($defined(outgoingLine)) { - outgoingLine.redraw(); - } - - // Update all the incoming lines ... - var incomingLines = this.getIncomingLines(); - for (var i = 0; i < incomingLines.length; i++) { - incomingLines[i].redraw(); - } - - // Update relationship lines - for (var j = 0; j < this._relationships.length; j++) { - this._relationships[j].redraw(); - } - }, - - /** */ - setBranchVisibility: function (value) { - var current = this; - var parent = this; - while (parent != null && !parent.isCentralTopic()) { - current = parent; - parent = current.getParent(); - } - current.setVisibility(value); - }, - - /** */ - setVisibility: function (value) { - this._setTopicVisibility(value); - - // Hide all children... - this._setChildrenVisibility(value); - - // If there there are connection to the node, topic must be hidden. - this._setRelationshipLinesVisibility(value); - - // If it's connected, the connection must be rendered. - var outgoingLine = this.getOutgoingLine(); - if (outgoingLine) { - outgoingLine.setVisibility(value); - } - }, - - /** */ - moveToBack: function () { - - // Update relationship lines - for (var j = 0; j < this._relationships.length; j++) { - this._relationships[j].moveToBack(); - } - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.moveToBack(); - } - - this.get2DElement().moveToBack(); - }, - - /** */ - moveToFront: function () { - - this.get2DElement().moveToFront(); - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.moveToFront(); - } - // Update relationship lines - for (var j = 0; j < this._relationships.length; j++) { - this._relationships[j].moveToFront(); - } - }, - - /** */ - isVisible: function () { - var elem = this.get2DElement(); - return elem.isVisible(); - }, - - _setRelationshipLinesVisibility: function (value) { - _.each(this._relationships, function (relationship) { - var sourceTopic = relationship.getSourceTopic(); - var targetTopic = relationship.getTargetTopic(); - - var targetParent = targetTopic.getModel().getParent(); - var sourceParent = sourceTopic.getModel().getParent(); - relationship.setVisibility(value && (targetParent == null || !targetParent.areChildrenShrunken()) && (sourceParent == null || !sourceParent.areChildrenShrunken())); - }); - }, - - _setTopicVisibility: function (value) { - var elem = this.get2DElement(); - elem.setVisibility(value); - - if (this.getIncomingLines().length > 0) { - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.setVisibility(value); - } - } - - var textShape = this.getTextShape(); - textShape.setVisibility(this.getShapeType() != mindplot.model.TopicShape.IMAGE ? value : false); - }, - - /** */ - setOpacity: function (opacity) { - var elem = this.get2DElement(); - elem.setOpacity(opacity); - - var connector = this.getShrinkConnector(); - if ($defined(connector)) { - connector.setOpacity(opacity); - } - var textShape = this.getTextShape(); - textShape.setOpacity(opacity); - }, - - _setChildrenVisibility: function (isVisible) { - - // Hide all children. - var children = this.getChildren(); - var model = this.getModel(); - - isVisible = isVisible ? !model.areChildrenShrunken() : isVisible; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - child.setVisibility(isVisible); - - var outgoingLine = child.getOutgoingLine(); - outgoingLine.setVisibility(isVisible); - } - - }, - - /** */ - invariant: function () { - var line = this._outgoingLine; - var model = this.getModel(); - var isConnected = model.isConnected(); - - // Check consistency... - if ((isConnected && !line) || (!isConnected && line)) { - // $assert(false,'Illegal state exception.'); - } - }, - - /** */ - setSize: function (size, force) { - $assert(size, "size can not be null"); - $assert($defined(size.width), "size seem not to be a valid element"); - size = {width: Math.ceil(size.width), height: Math.ceil(size.height)}; - - var oldSize = this.getSize(); - var hasSizeChanged = oldSize.width != size.width || oldSize.height != size.height; - if (hasSizeChanged || force) { - mindplot.NodeGraph.prototype.setSize.call(this, size); - - var outerShape = this.getOuterShape(); - var innerShape = this.getInnerShape(); - - outerShape.setSize(size.width + 4, size.height + 6); - innerShape.setSize(size.width, size.height); - - // Update the figure position(ej: central topic must be centered) and children position. - this._updatePositionOnChangeSize(oldSize, size); - - if (hasSizeChanged) { - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeResizeEvent, { - node: this.getModel(), - size: size - }); - } - } - }, - - _updatePositionOnChangeSize: function () { - $assert(false, "this method must be overwrited."); - }, - - /** */ - disconnect: function (workspace) { - var outgoingLine = this.getOutgoingLine(); - if ($defined(outgoingLine)) { - $assert(workspace, 'workspace can not be null'); - - this._outgoingLine = null; - - // Disconnect nodes ... - var targetTopic = outgoingLine.getTargetTopic(); - targetTopic.removeChild(this); - - // Update model ... - var childModel = this.getModel(); - childModel.disconnect(); - - this._parent = null; - - // Remove graphical element from the workspace... - outgoingLine.removeFromWorkspace(workspace); - - // Remove from workspace. - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeDisconnectEvent, this.getModel()); - - // Change text based on the current connection ... - var model = this.getModel(); - if (!model.getText()) { - var text = this.getText(); - this._setText(text, false); - } - if (!model.getFontSize()) { - var size = this.getFontSize(); - this.setFontSize(size, false); - } - - // Hide connection line?. - if (targetTopic.getChildren().length == 0) { - var connector = targetTopic.getShrinkConnector(); - if ($defined(connector)) { - connector.setVisibility(false); - } - } - } - }, - - /** */ - getOrder: function () { - var model = this.getModel(); - return model.getOrder(); - }, - - /** */ - setOrder: function (value) { - var model = this.getModel(); - model.setOrder(value); - }, - - /** */ - connectTo: function (targetTopic, workspace) { - $assert(!this._outgoingLine, 'Could not connect an already connected node'); - $assert(targetTopic != this, 'Circular connection are not allowed'); - $assert(targetTopic, 'Parent Graph can not be null'); - $assert(workspace, 'Workspace can not be null'); - - // Connect Graphical Nodes ... - targetTopic.append(this); - this._parent = targetTopic; - - // Update model ... - var targetModel = targetTopic.getModel(); - var childModel = this.getModel(); - childModel.connectTo(targetModel); - - // Create a connection line ... - var outgoingLine = new mindplot.ConnectionLine(this, targetTopic); - outgoingLine.setVisibility(false); - - this._outgoingLine = outgoingLine; - workspace.append(outgoingLine); - - // Update figure is necessary. - this.updateTopicShape(targetTopic); - - // Change text based on the current connection ... - var model = this.getModel(); - if (!model.getText()) { - var text = this.getText(); - this._setText(text, false); - } - if (!model.getFontSize()) { - var size = this.getFontSize(); - this.setFontSize(size, false); - } - this.getTextShape(); - - // Display connection node... - var connector = targetTopic.getShrinkConnector(); - if ($defined(connector)) { - connector.setVisibility(true); - } - - // Redraw line ... - outgoingLine.redraw(); - - // Fire connection event ... - if (this.isInWorkspace()) { - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, { - parentNode: targetTopic.getModel(), - childNode: this.getModel() - }); - } - }, - - /** */ - append: function (child) { - var children = this.getChildren(); - children.push(child); - }, - - /** */ - removeChild: function (child) { - var children = this.getChildren(); - children.erase(child); - }, - - /** */ - getChildren: function () { - var result = this._children; - if (!$defined(result)) { - this._children = []; - result = this._children; - } - return result; - }, - - /** */ - removeFromWorkspace: function (workspace) { - var elem2d = this.get2DElement(); - workspace.removeChild(elem2d); - var line = this.getOutgoingLine(); - if ($defined(line)) { - workspace.removeChild(line); - } - this._isInWorkspace = false; - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeRemoved, this.getModel()); - }, - - /** */ - addToWorkspace: function (workspace) { - var elem = this.get2DElement(); - workspace.append(elem); - if (!this.isInWorkspace()) { - if (!this.isCentralTopic()) { - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeAdded, this.getModel()); - } - - if (this.getModel().isConnected()) - mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, { - parentNode: this.getOutgoingConnectedTopic().getModel(), - childNode: this.getModel() - }); - - } - this._isInWorkspace = true; - this._adjustShapes(); - }, - - /** */ - isInWorkspace: function () { - return this._isInWorkspace; - }, - - /** */ - createDragNode: function (layoutManager) { - var result = this.parent(layoutManager); - - // Is the node already connected ? - var targetTopic = this.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { - result.connectTo(targetTopic); - result.setVisibility(false); - } - - // If a drag node is create for it, let's hide the editor. - this._getTopicEventDispatcher().close(); - - return result; - }, - - _adjustShapes: function () { - if (this._isInWorkspace) { - - var textShape = this.getTextShape(); - if (this.getShapeType() != mindplot.model.TopicShape.IMAGE) { - - var textWidth = textShape.getWidth(); - - var textHeight = textShape.getHeight(); - textHeight = textHeight != 0 ? textHeight : 20; - - var topicPadding = mindplot.TopicStyle.getInnerPadding(this); - - // Adjust the icon size to the size of the text ... - var iconGroup = this.getOrBuildIconGroup(); - var fontHeight = this.getTextShape().getFontHeight(); - iconGroup.setPosition(topicPadding, topicPadding); - iconGroup.seIconSize(fontHeight, fontHeight); - - // Add a extra padding between the text and the icons - var iconsWidth = iconGroup.getSize().width; - if (iconsWidth != 0) { - - iconsWidth = iconsWidth + (textHeight / 4); - } - - var height = textHeight + (topicPadding * 2); - var width = textWidth + iconsWidth + (topicPadding * 2); - - this.setSize({width: width, height: height}); - - // Position node ... - textShape.setPosition(topicPadding + iconsWidth, topicPadding); - } else { - // In case of images, the size if fixed ... - var size = this.getModel().getImageSize(); - this.setSize(size); - } - } - }, - - _flatten2DElements: function (topic) { - var result = []; - - var children = topic.getChildren(); - for (var i = 0; i < children.length; i++) { - - var child = children[i]; - result.push(child); - result.push(child.getOutgoingLine()); - - var relationships = child.getRelationships(); - result = result.concat(relationships); - - if (!child.areChildrenShrunken()) { - var innerChilds = this._flatten2DElements(child); - result = result.concat(innerChilds); - } - } - return result; - }, - - /** - * @param childTopic - * @return {Boolean} true if childtopic is a child topic of this topic or the topic itself - */ - isChildTopic: function (childTopic) { - var result = (this.getId() == childTopic.getId()); - if (!result) { - var children = this.getChildren(); - for (var i = 0; i < children.length; i++) { - var parent = children[i]; - result = parent.isChildTopic(childTopic); - if (result) { - break; - } - } - } - return result; - }, - - /** @return {Boolean} true if the topic is the central topic of the map */ - isCentralTopic: function () { - return this.getModel().getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE; - } - - -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.Topic.CONNECTOR_WIDTH = 6; -/** - * @constant - * @type {Object} - * @default - */ -mindplot.Topic.OUTER_SHAPE_ATTRIBUTES = {fillColor: 'rgb(252,235,192)', stroke: '1 dot rgb(241,163,39)', x: 0, y: 0}; -/** - * @constant - * @type {Object} - * @default - */ -mindplot.Topic.OUTER_SHAPE_ATTRIBUTES_FOCUS = {fillColor: 'rgb(244,184,45)', x: 0, y: 0}; -/** - * @constant - * @type {Object} - * @default - * */ -mindplot.Topic.INNER_RECT_ATTRIBUTES = {stroke: '2 solid'}; - - - diff --git a/mindplot/src/main/javascript/TopicEventDispatcher.js b/mindplot/src/main/javascript/TopicEventDispatcher.js deleted file mode 100644 index 015463df..00000000 --- a/mindplot/src/main/javascript/TopicEventDispatcher.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.TopicEventDispatcher = new Class({ - Extends: mindplot.Events, - Static: { - _instance: null, - - configure: function (readOnly) { - this._instance = new mindplot.TopicEventDispatcher(readOnly); - }, - - getInstance: function () { - return this._instance; - } - }, - - initialize: function (readOnly) { - this._readOnly = readOnly; - this._activeEditor = null; - this._multilineEditor = new mindplot.MultilineTextEditor(); - }, - - close: function (update) { - if (this.isVisible()) { - this._activeEditor.close(update); - this._activeEditor = null; - } - }, - - show: function (topic, options) { - this.process(mindplot.TopicEvent.EDIT, topic, options); - }, - - process: function (eventType, topic, options) { - $assert(eventType, "eventType can not be null"); - - // Close all previous open editor .... - if (this.isVisible()) { - this.close(); - } - - // Open the new editor ... - var model = topic.getModel(); - if (model.getShapeType() != mindplot.model.TopicShape.IMAGE && !this._readOnly && eventType == mindplot.TopicEvent.EDIT) { - this._multilineEditor.show(topic, options ? options.text : null); - this._activeEditor = this._multilineEditor; - } else { - this.fireEvent(eventType, {model: model, readOnly: this._readOnly}); - } - }, - - isVisible: function () { - return this._activeEditor != null && this._activeEditor.isVisible(); - } -}); - - -mindplot.TopicEvent = { - EDIT: "editnode", - CLICK: "clicknode" -}; - diff --git a/mindplot/src/main/javascript/TopicFeature.js b/mindplot/src/main/javascript/TopicFeature.js deleted file mode 100644 index 19d1e20c..00000000 --- a/mindplot/src/main/javascript/TopicFeature.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -/** */ -mindplot.TopicFeature = { - /** the icon object */ - Icon: { - id: mindplot.model.IconModel.FEATURE_TYPE, - model: mindplot.model.IconModel, - icon: mindplot.ImageIcon - }, - - /** the link object */ - Link: { - id: mindplot.model.LinkModel.FEATURE_TYPE, - model: mindplot.model.LinkModel, - icon: mindplot.LinkIcon - }, - - /** the note object */ - Note: { - id: mindplot.model.NoteModel.FEATURE_TYPE, - model: mindplot.model.NoteModel, - icon: mindplot.NoteIcon - }, - - /** - * @param id the feature metadata id - * @return {Boolean} returns true if the given id is contained in the metadata array - */ - isSupported: function (id) { - return mindplot.TopicFeature._featuresMetadataById.some(function (elem) { - return elem.id == id; - }); - }, - - /** - * @param type - * @param attributes - * @throws will throw an error if type is null or undefined - * @throws will throw an error if attributes is null or undefined - * @return {mindplot.model.FeatureModel} a new instance of the feature model subclass matching - * the topic feature - */ - createModel: function (type, attributes) { - $assert(type, 'type can not be null'); - $assert(attributes, 'attributes can not be null'); - - var model = mindplot.TopicFeature._featuresMetadataById.filter(function (elem) { - return elem.id == type; - })[0].model; - return new model(attributes); - }, - - /** - * @param {mindplot.Topic} topic - * @param {mindplot.model.FeatureModel} model - * @param {Boolean} readOnly true if the editor is running in read-only mode - * @throws will throw an error if topic is null or undefined - * @throws will throw an error if model is null or undefined - * @return {mindplot.Icon} a new instance of the icon subclass matching the topic feature - */ - createIcon: function (topic, model, readOnly) { - $assert(topic, 'topic can not be null'); - $assert(model, 'model can not be null'); - - var icon = mindplot.TopicFeature._featuresMetadataById.filter(function (elem) { - return elem.id == model.getType(); - })[0].icon; - return new icon(topic, model, readOnly); - } -}; - -mindplot.TopicFeature._featuresMetadataById = [mindplot.TopicFeature.Icon, mindplot.TopicFeature.Link, mindplot.TopicFeature.Note]; - - diff --git a/mindplot/src/main/javascript/TopicStyle.js b/mindplot/src/main/javascript/TopicStyle.js deleted file mode 100644 index ce719342..00000000 --- a/mindplot/src/main/javascript/TopicStyle.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ -mindplot.TopicStyle = new Class({ - Static: { - _getStyles: function (topic) { - $assert(topic, "topic can not be null"); - - var result; - if (topic.isCentralTopic()) { - result = mindplot.TopicStyle.STYLES.CENTRAL_TOPIC; - } else { - var targetTopic = topic.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { - if (targetTopic.isCentralTopic()) { - result = mindplot.TopicStyle.STYLES.MAIN_TOPIC; - } else { - result = mindplot.TopicStyle.STYLES.SUB_TOPIC; - } - } else { - result = mindplot.TopicStyle.STYLES.ISOLATED_TOPIC; - } - } - return result; - }, - - defaultText: function (topic) { - var msgKey = this._getStyles(topic).msgKey; - return $msg(msgKey); - }, - - defaultFontStyle: function (topic) { - return this._getStyles(topic).fontStyle; - }, - - defaultBackgroundColor: function (topic) { - return this._getStyles(topic).backgroundColor; - }, - - defaultBorderColor: function (topic) { - return this._getStyles(topic).borderColor; - }, - - getInnerPadding: function (topic) { - return this._getStyles(topic).innerPadding; - }, - - defaultShapeType: function (topic) { - return this._getStyles(topic).shapeType; - } - - } -}); - -mindplot.TopicStyle.STYLES = -{ - CENTRAL_TOPIC: { - borderColor: 'rgb(57,113,177)', - backgroundColor: 'rgb(80,157,192)', - fontStyle: { - font: "Verdana", - size: 10, - style: "normal", - weight: "bold", - color: "#ffffff" - }, - msgKey: 'CENTRAL_TOPIC', - innerPadding: 11, - shapeType: mindplot.model.TopicShape.ROUNDED_RECT - }, - - MAIN_TOPIC: { - borderColor: 'rgb(2,59,185)', - backgroundColor: 'rgb(224,229,239)', - fontStyle: { - font: "Arial", - size: 8, - style: "normal", - weight: "normal", - color: "rgb(82,92,97)" - }, - msgKey: 'MAIN_TOPIC', - innerPadding: 3, - shapeType: mindplot.model.TopicShape.LINE - - }, - - SUB_TOPIC: { - borderColor: 'rgb(2,59,185)', - backgroundColor: 'rgb(224,229,239)', - fontStyle: { - font: "Arial", - size: 6, - style: "normal", - weight: "normal", - color: "rgb(82,92,97)" - }, - msgKey: 'SUB_TOPIC', - innerPadding: 3, - shapeType: mindplot.model.TopicShape.LINE - }, - - ISOLATED_TOPIC: { - borderColor: 'rgb(2,59,185)', - backgroundColor: 'rgb(224,229,239)', - fontStyle: { - font: "Verdana", - size: 8, - style: "normal", - weight: "normal", - color: "rgb(82,92,97)" - }, - msgKey: 'ISOLATED_TOPIC', - innerPadding: 4, - shapeType: mindplot.model.TopicShape.LINE - } -}; - diff --git a/mindplot/src/main/javascript/Workspace.js b/mindplot/src/main/javascript/Workspace.js deleted file mode 100644 index c4481d2a..00000000 --- a/mindplot/src/main/javascript/Workspace.js +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.Workspace = new Class({ - initialize: function (screenManager, zoom) { - // Create a suitable container ... - $assert(screenManager, 'Div container can not be null'); - $assert(zoom, 'zoom container can not be null'); - - this._zoom = zoom; - this._screenManager = screenManager; - - var divContainer = screenManager.getContainer(); - this._screenWidth = parseInt(divContainer.css('width')); - this._screenHeight = parseInt(divContainer.css('height')); - - // Initialize web2d workspace. - var workspace = this._createWorkspace(); - this._workspace = workspace; - - // Append to the workspace... - workspace.addItAsChildTo(divContainer); - this.setZoom(zoom, true); - - // Register drag events ... - this._registerDragEvents(); - this._eventsEnabled = true; - }, - - _createWorkspace: function () { - // Initialize workspace ... - var coordOriginX = -(this._screenWidth / 2); - var coordOriginY = -(this._screenHeight / 2); - - var workspaceProfile = { - width: this._screenWidth + "px", - height: this._screenHeight + "px", - coordSizeWidth: this._screenWidth, - coordSizeHeight: this._screenHeight, - coordOriginX: coordOriginX, - coordOriginY: coordOriginY, - fillColor: 'transparent', - strokeWidth: 0 - }; - web2d.peer.Toolkit.init(); - return new web2d.Workspace(workspaceProfile); - }, - - append: function (shape) { - if ($defined(shape.addToWorkspace)) { - shape.addToWorkspace(this); - } else { - this._workspace.append(shape); - } - }, - - removeChild: function (shape) { - // Element is a node, not a web2d element? - if ($defined(shape.removeFromWorkspace)) { - shape.removeFromWorkspace(this); - } else { - this._workspace.removeChild(shape); - } - }, - - addEvent: function (type, listener) { - this._workspace.addEvent(type, listener); - }, - - removeEvent: function (type, listener) { - $assert(type, 'type can not be null'); - $assert(listener, 'listener can not be null'); - this._workspace.removeEvent(type, listener); - }, - - getSize: function () { - return this._workspace.getCoordSize(); - }, - - setZoom: function (zoom, center) { - this._zoom = zoom; - var workspace = this._workspace; - - // Update coord scale... - var coordWidth = zoom * this._screenWidth; - var coordHeight = zoom * this._screenHeight; - workspace.setCoordSize(coordWidth, coordHeight); - - // View port coords ... - if (this._viewPort) { - this._viewPort.width = this._viewPort.width * zoom; - this._viewPort.height = this._viewPort.height * zoom; - } - - // Center topic.... - var coordOriginX; - var coordOriginY; - - if (center) { - if (this._viewPort) { - coordOriginX = -(this._viewPort.width / 2); - coordOriginY = -(this._viewPort.height / 2); - } else { - coordOriginX = -(coordWidth / 2); - coordOriginY = -(coordHeight / 2); - } - } else { - var coordOrigin = workspace.getCoordOrigin(); - coordOriginX = coordOrigin.x; - coordOriginY = coordOrigin.y; - } - - workspace.setCoordOrigin(coordOriginX, coordOriginY); - - // Update screen. - this._screenManager.setOffset(coordOriginX, coordOriginY); - this._screenManager.setScale(zoom); - - // Some changes in the screen. Let's fire an update event... - this._screenManager.fireEvent('update'); - }, - - getScreenManager: function () { - return this._screenManager; - }, - - enableWorkspaceEvents: function (value) { - this._eventsEnabled = value; - }, - - isWorkspaceEventsEnabled: function () { - return this._eventsEnabled; - }, - - dumpNativeChart: function () { - return this._workspace.dumpNativeChart(); - }, - - _registerDragEvents: function () { - var workspace = this._workspace; - var screenManager = this._screenManager; - var mWorkspace = this; - var mouseDownListener = function (event) { - if (!$defined(workspace._mouseMoveListener)) { - if (mWorkspace.isWorkspaceEventsEnabled()) { - mWorkspace.enableWorkspaceEvents(false); - - var mouseDownPosition = screenManager.getWorkspaceMousePosition(event); - var originalCoordOrigin = workspace.getCoordOrigin(); - - var wasDragged = false; - workspace._mouseMoveListener = function (event) { - - var currentMousePosition = screenManager.getWorkspaceMousePosition(event); - - var offsetX = currentMousePosition.x - mouseDownPosition.x; - var coordOriginX = -offsetX + originalCoordOrigin.x; - - var offsetY = currentMousePosition.y - mouseDownPosition.y; - var coordOriginY = -offsetY + originalCoordOrigin.y; - - workspace.setCoordOrigin(coordOriginX, coordOriginY); - - // Change cursor. - if (Browser.firefox) { - window.document.body.style.cursor = "-moz-grabbing"; - } else { - window.document.body.style.cursor = "move"; - } - event.preventDefault(); - - // Fire drag event ... - screenManager.fireEvent('update'); - wasDragged = true; - - - }; - screenManager.addEvent('mousemove', workspace._mouseMoveListener); - - // Register mouse up listeners ... - workspace._mouseUpListener = function (event) { - - screenManager.removeEvent('mousemove', workspace._mouseMoveListener); - screenManager.removeEvent('mouseup', workspace._mouseUpListener); - workspace._mouseUpListener = null; - workspace._mouseMoveListener = null; - window.document.body.style.cursor = 'default'; - - // Update screen manager offset. - var coordOrigin = workspace.getCoordOrigin(); - screenManager.setOffset(coordOrigin.x, coordOrigin.y); - mWorkspace.enableWorkspaceEvents(true); - - if (!wasDragged) { - screenManager.fireEvent('click'); - } - }; - screenManager.addEvent('mouseup', workspace._mouseUpListener); - } - } else { - workspace._mouseUpListener(); - } - }; - screenManager.addEvent('mousedown', mouseDownListener); - }, - - setViewPort: function (size) { - this._viewPort = size; - } -}); - - diff --git a/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js b/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js deleted file mode 100644 index 81e3dde6..00000000 --- a/mindplot/src/main/javascript/commands/AddFeatureToTopicCommand.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.AddFeatureToTopicCommand = new Class(/** @lends AddFeatureToTopicCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command class handles do/undo of adding features to topics, e.g. an - * icon or a note. For a reference of existing features, refer to {@link mindplot.TopicFeature} - * @constructs - * @param {String} topicId the id of the topic - * @param {String} featureType the id of the feature type to add, e.g. "icon" - * @param {Object} attributes the attribute(s) of the respective feature model - * @extends mindplot.Command - * @see mindplot.model.FeatureModel and subclasses - */ - initialize:function (topicId, featureType, attributes) { - - $assert($defined(topicId), 'topicId can not be null'); - $assert(featureType, 'featureType can not be null'); - $assert(attributes, 'attributes can not be null'); - - this.parent(); - this._topicId = topicId; - this._featureType = featureType; - this._attributes = attributes; - this._featureModel = null; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - var topic = commandContext.findTopics(this._topicId)[0]; - - // Feature must be created only one time. - if (!this._featureModel) { - var model = topic.getModel(); - this._featureModel = model.createFeature(this._featureType, this._attributes); - } - topic.addFeature(this._featureModel); - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - var topic = commandContext.findTopics(this._topicId)[0]; - topic.removeFeature(this._featureModel); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/AddRelationshipCommand.js b/mindplot/src/main/javascript/commands/AddRelationshipCommand.js deleted file mode 100644 index 2e9da1ab..00000000 --- a/mindplot/src/main/javascript/commands/AddRelationshipCommand.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.AddRelationshipCommand = new Class(/** @lends AddRelationshipCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command class handles do/undo of adding a relationship to a topic. - * @constructs - * @param {XMLDOM} model - * @extends mindplot.Command - */ - initialize:function (model) { - $assert(model, 'Relationship model can not be null'); - - this.parent(); - this._model = model; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - var relationship = commandContext.addRelationship(this._model); - relationship.setOnFocus(true); - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - var rel = commandContext.findRelationships(this._model.getId()); - commandContext.deleteRelationship(rel[0]); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/AddTopicCommand.js b/mindplot/src/main/javascript/commands/AddTopicCommand.js deleted file mode 100644 index 73459d99..00000000 --- a/mindplot/src/main/javascript/commands/AddTopicCommand.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.AddTopicCommand = new Class(/** @lends AddTopicCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command class handles do/undo of adding one or multiple topics to - * the mindmap. - * @constructs - * @param {Array} models one or multiple models - * @param {Array} parentTopicsId ids of the parent topics to add the children to, or null - * when attaching a dragged node or a node/branch from clipboard - * @extends mindplot.Command - */ - initialize:function (models, parentTopicsId) { - $assert(models, 'models can not be null'); - $assert(parentTopicsId == null || parentTopicsId.length == models.length, 'parents and models must have the same size'); - - this.parent(); - this._models = models; - this._parentsIds = parentTopicsId; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - - var me = this; - _.each(this._models, function (model, index) { - - // Add a new topic ... - var topic = commandContext.createTopic(model); - - // Connect to topic ... - if (me._parentsIds) { - var parentId = me._parentsIds[index]; - if ($defined(parentId)) { - var parentTopic = commandContext.findTopics(parentId)[0]; - commandContext.connect(topic, parentTopic); - } - } else { - commandContext.addTopic(topic); - } - - // Select just created node ... - var designer = commandContext._designer; - designer.onObjectFocusEvent(topic); - topic.setOnFocus(true); - - // Render node ... - topic.setVisibility(true); - - }); - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - // Delete disconnected the nodes. Create a copy of the topics ... - var clonedModel = []; - _.each(this._models, function (model) { - clonedModel.push(model.clone()); - }); - - // Finally, remove the nodes ... - _.each(this._models, function (model) { - - var topicId = model.getId(); - var topic = commandContext.findTopics(topicId)[0]; - commandContext.deleteTopic(topic); - }); - - this._models = clonedModel; - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js b/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js deleted file mode 100644 index 2110c90f..00000000 --- a/mindplot/src/main/javascript/commands/ChangeFeatureToTopicCommand.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.ChangeFeatureToTopicCommand = new Class(/** @lends ChangeFeatureToTopicCommand */{ - Extends:mindplot.Command, - /** - * @extends mindplot.Command - * @constructs - * @param topicId - * @param featureId - * @param attributes - * @throws will throw an error if topicId is null or undefined - * @throws will throw an error if featureId is null or undefined - * @throws will throw an error if attributes is null or undefined - */ - initialize: function(topicId, featureId, attributes) { - $assert($defined(topicId), 'topicId can not be null'); - $assert($defined(featureId), 'featureId can not be null'); - $assert($defined(attributes), 'attributes can not be null'); - - this.parent(); - this._topicId = topicId; - this._featureId = featureId; - this._attributes = attributes; - }, - - /** - * Overrides abstract parent method - */ - execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicId)[0]; - var feature = topic.findFeatureById(this._featureId); - - var oldAttributes = feature.getAttributes(); - feature.setAttributes(this._attributes); - this._attributes = oldAttributes; - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute: function(commandContext) { - this.execute(commandContext); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/DeleteCommand.js b/mindplot/src/main/javascript/commands/DeleteCommand.js deleted file mode 100644 index 4046f309..00000000 --- a/mindplot/src/main/javascript/commands/DeleteCommand.js +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.DeleteCommand = new Class(/** @lends mindplot.commands.DeleteCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command class handles do/undo of deleting a topic. - * @constructs - * @param {Array} topicIds ids of the topics to delete - * @param {Array} relIds ids of the relationships connected to the topics - * @extends mindplot.Command - */ - initialize:function (topicIds, relIds) { - $assert($defined(relIds), 'topicIds can not be null'); - - this.parent(); - this._relIds = relIds; - this._topicIds = topicIds; - this._deletedTopicModels = []; - this._deletedRelModel = []; - this._parentTopicIds = []; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - - // If a parent has been selected for deletion, the children must be excluded from the delete ... - var topics = this._filterChildren(this._topicIds, commandContext); - - if (topics.length > 0) { - _.each(topics, function (topic) { - // In case that it's editing text node, force close without update ... - topic.closeEditors(); - - var model = topic.getModel(); - - // Delete relationships - var relationships = this._collectInDepthRelationships(topic); - this._deletedRelModel.append(relationships.map(function (rel) { - return rel.getModel().clone(); - })); - - _.each(relationships, function (relationship) { - commandContext.deleteRelationship(relationship); - }); - - // Store information for undo ... - var clonedModel = model.clone(); - this._deletedTopicModels.push(clonedModel); - var outTopic = topic.getOutgoingConnectedTopic(); - var outTopicId = null; - if (outTopic != null) { - outTopicId = outTopic.getId(); - } - this._parentTopicIds.push(outTopicId); - - // Finally, delete the topic from the workspace... - commandContext.deleteTopic(topic); - - }, this); - } - - var rels = commandContext.findRelationships(this._relIds); - if (rels.length > 0) { - _.each(rels, function (rel) { - this._deletedRelModel.push(rel.getModel().clone()); - commandContext.deleteRelationship(rel); - }, this); - } - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - - // Add all the topics ... - _.each(this._deletedTopicModels, function (model) { - commandContext.createTopic(model); - }, this); - - // Do they need to be connected ? - _.each(this._deletedTopicModels, function (topicModel, index) { - var topics = commandContext.findTopics(topicModel.getId()); - - var parentId = this._parentTopicIds[index]; - if (parentId) { - var parentTopics = commandContext.findTopics(parentId); - commandContext.connect(topics[0], parentTopics[0]); - } - }, this); - - // Add rebuild relationships ... - _.each(this._deletedRelModel, function (model) { - commandContext.addRelationship(model); - }); - - // Finally display the topics ... - _.each(this._deletedTopicModels, function (topicModel) { - var topics = commandContext.findTopics(topicModel.getId()); - topics[0].setBranchVisibility(true); - }, this); - - // Focus on last recovered topic .. - if (this._deletedTopicModels.length > 0) { - var firstTopic = this._deletedTopicModels[0]; - var topic = commandContext.findTopics(firstTopic.getId())[0]; - topic.setOnFocus(true); - } - - this._deletedTopicModels = []; - this._parentTopicIds = []; - this._deletedRelModel = []; - }, - - _filterChildren:function (topicIds, commandContext) { - var topics = commandContext.findTopics(topicIds); - - var result = []; - _.each(topics, function (topic) { - var parent = topic.getParent(); - var found = false; - while (parent != null && !found) { - found = topicIds.contains(parent.getId()); - if (found) { - break; - } - parent = parent.getParent(); - } - - if (!found) { - result.push(topic); - } - }); - - return result; - }, - - _collectInDepthRelationships:function (topic) { - var result = []; - result.append(topic.getRelationships()); - - var children = topic.getChildren(); - var rels = children.map(function (topic) { - return this._collectInDepthRelationships(topic); - }, this); - result.append(rels.flatten()); - - if (result.length > 0) { - // Filter for unique ... - result = result.sort(function (a, b) { - return a.getModel().getId() - b.getModel().getId(); - }); - var ret = [result[0]]; - for (var i = 1; i < result.length; i++) { // start loop at 1 as element 0 can never be a duplicate - if (result[i - 1] !== result[i]) { - ret.push(result[i]); - } - } - result = ret; - } - return result; - } - -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js deleted file mode 100644 index 478aa6e6..00000000 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.DragTopicCommand = new Class(/** @lends DragTopicCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command class handles do/undo of dragging a topic to a new position. - * @constructs - * @param {String} topicId id of the topic to drag - * @param {Object} position - * @param {Number} order the order property (children of one node are displayed in order from 0 to n) - * @param {mindplot.Topic} parentTopic the topic to be made the dragged topic's new parent - * @extends mindplot.Command - */ - initialize:function (topicId, position, order, parentTopic) { - $assert(topicId, "topicId must be defined"); - - this._topicsId = topicId; - if ($defined(parentTopic)) - this._parentId = parentTopic.getId(); - - this.parent(); - this._position = position; - this._order = order; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - - var topic = commandContext.findTopics(this._topicsId)[0]; - topic.setVisibility(false); - - // Save old position ... - var origParentTopic = topic.getOutgoingConnectedTopic(); - - // In this case, topics are positioned using order ... - var origOrder = topic.getOrder(); - var origPosition = topic.getPosition(); - - // Disconnect topic .. - if ($defined(origParentTopic) && origParentTopic != this._parentId) { - commandContext.disconnect(topic); - } - - // Set topic order ... - if (this._order != null) { - topic.setOrder(this._order); - } else if (this._position != null) { - commandContext.moveTopic(topic, this._position); - } else { - $assert("Illegal command state exception."); - } - - // Finally, connect topic ... - if (origParentTopic != this._parentId) { - - if ($defined(this._parentId)) { - var parentTopic = commandContext.findTopics(this._parentId)[0]; - commandContext.connect(topic, parentTopic); - } - - // Backup old parent id ... - this._parentId = null; - if ($defined(origParentTopic)) { - this._parentId = origParentTopic.getId(); - } - } - topic.setVisibility(true); - - // Store for undo ... - this._order = origOrder; - this._position = origPosition; - - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - this.execute(commandContext); - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js deleted file mode 100644 index 8cf4eb0b..00000000 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.GenericFunctionCommand = new Class(/** @lends GenericFunctionCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command handles do/undo of different actions, e.g. moving topics to - * a different position, changing text or font,... (for full reference check the - * StandaloneActionDispatcher i.e. the ActionDispatcher subclass in use) - * @constructs - * @param {Function} commandFunc the function the command shall execute - * @param {String|Array} topicsIds the ids of the topics affected - * @param {Object} [value] value arbitrary value necessary for the execution of the function, - * e.g. color, font family or text - * @extends mindplot.Command - */ - initialize:function (commandFunc, topicsIds, value) { - $assert(commandFunc, "commandFunc must be defined"); - $assert($defined(topicsIds), "topicsIds must be defined"); - - this.parent(); - this._value = value; - this._topicsId = topicsIds; - this._commandFunc = commandFunc; - this._oldValues = []; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - if (!this.applied) { - - var topics = null; - try { - topics = commandContext.findTopics(this._topicsId); - } catch (e) { - if (this._commandFunc.commandType != "changeTextToTopic") { - // Workaround: For some reason, there is a combination of events that involves - // making some modification and firing out of focus event. This is causing - // that a remove node try to be removed. In some other life, I will come with the solution. - // Almost aways occurs with IE9. I could be related with some change of order in sets o something similar. - throw e; - } - } - - if (topics != null) { - var me = this; - _.each(topics, function (topic) { - var oldValue = me._commandFunc(topic, me._value); - me._oldValues.push(oldValue); - }); - } - this.applied = true; - - } else { - throw "Command can not be applied two times in a row."; - } - - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - if (this.applied) { - var topics = commandContext.findTopics(this._topicsId); - var me = this; - _.each(topics, function (topic, index) { - me._commandFunc(topic, me._oldValues[index]); - - }); - - this.applied = false; - this._oldValues = []; - } else { - throw "undo can not be applied."; - } - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js b/mindplot/src/main/javascript/commands/MoveControlPointCommand.js deleted file mode 100644 index 9d94e6d3..00000000 --- a/mindplot/src/main/javascript/commands/MoveControlPointCommand.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.MoveControlPointCommand = new Class(/** @lends MoveControlPointCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command handles do/undo of changing the control points of a relationship - * arrow. These are the two points that appear when the relationship is on focus. They - * influence how the arrow is drawn (not the source or the destination topic nor the arrow - * direction) - * @constructs - * @param {ControlPoint} ctrlPointController - * @param {Number} point 0 for the destination control point, 1 for the source control point - * @param ctrlPointController {ControlPoint} - * @param point {Number} 0 for the destination control point, 1 for the source control point - */ - initialize:function (ctrlPointController, point) { - $assert(ctrlPointController, 'line can not be null'); - $assert($defined(point), 'point can not be null'); - - this.parent(); - this._ctrlPointControler = ctrlPointController; - this._line = ctrlPointController._line; - this._controlPoint = this._ctrlPointControler.getControlPoint(point).clone(); - this._oldControlPoint = this._ctrlPointControler.getOriginalCtrlPoint(point).clone(); - this._originalEndPoint = this._ctrlPointControler.getOriginalEndPoint(point).clone(); - switch (point) { - case 0: - this._wasCustom = this._line.getLine().isSrcControlPointCustom(); - this._endPoint = this._line.getLine().getFrom().clone(); - break; - case 1: - this._wasCustom = this._line.getLine().isDestControlPointCustom(); - this._endPoint = this._line.getLine().getTo().clone(); - break; - } - this._point = point; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - var model = this._line.getModel(); - switch (this._point) { - case 0: - model.setSrcCtrlPoint(this._controlPoint.clone()); - this._line.setFrom(this._endPoint.x, this._endPoint.y); - this._line.setIsSrcControlPointCustom(true); - this._line.setSrcControlPoint(this._controlPoint.clone()); - break; - case 1: - model.setDestCtrlPoint(this._controlPoint.clone()); - this._wasCustom = this._line.getLine().isDestControlPointCustom(); - this._line.setTo(this._endPoint.x, this._endPoint.y); - this._line.setIsDestControlPointCustom(true); - this._line.setDestControlPoint(this._controlPoint.clone()); - break; - } - if (this._line.isOnFocus()) { - this._line._refreshShape(); - this._ctrlPointControler.setLine(this._line); - } - this._line.getLine().updateLine(this._point); - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - var line = this._line; - var model = line.getModel(); - switch (this._point) { - case 0: - if ($defined(this._oldControlPoint)) { - line.setFrom(this._originalEndPoint.x, this._originalEndPoint.y); - model.setSrcCtrlPoint(this._oldControlPoint.clone()); - line.setSrcControlPoint(this._oldControlPoint.clone()); - line.setIsSrcControlPointCustom(this._wasCustom); - } - break; - case 1: - if ($defined(this._oldControlPoint)) { - line.setTo(this._originalEndPoint.x, this._originalEndPoint.y); - model.setDestCtrlPoint(this._oldControlPoint.clone()); - line.setDestControlPoint(this._oldControlPoint.clone()); - line.setIsDestControlPointCustom(this._wasCustom); - } - break; - } - this._line.getLine().updateLine(this._point); - if (this._line.isOnFocus()) { - this._ctrlPointControler.setLine(line); - line._refreshShape(); - } - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js deleted file mode 100644 index e7dda1c7..00000000 --- a/mindplot/src/main/javascript/commands/RemoveFeatureFromTopicCommand.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.commands.RemoveFeatureFromTopicCommand = new Class(/**@lends RemoveFeatureFromTopicCommand */{ - Extends:mindplot.Command, - /** - * @classdesc This command handles do/undo of removing a feature from a topic, e.g. an icon or - * a note. For a reference of existing features, refer to {@link mindplot.TopicFeature}. - * @constructs - * @param {String} topicId id of the topic to remove the feature from - * @param {String} featureId id of the feature to remove - * @extends mindplot.Command - */ - initialize:function (topicId, featureId) { - $assert($defined(topicId), 'topicId can not be null'); - $assert(featureId, 'iconModel can not be null'); - - this.parent(); - this._topicId = topicId; - this._featureId = featureId; - this._oldFeature = null; - }, - - /** - * Overrides abstract parent method - */ - execute:function (commandContext) { - var topic = commandContext.findTopics(this._topicId)[0]; - var feature = topic.findFeatureById(this._featureId); - topic.removeFeature(feature); - this._oldFeature = feature; - }, - - /** - * Overrides abstract parent method - * @see {@link mindplot.Command.undoExecute} - */ - undoExecute:function (commandContext) { - var topic = commandContext.findTopics(this._topicId)[0]; - topic.addFeature(this._oldFeature); - this._oldFeature = null; - } -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/footer.js b/mindplot/src/main/javascript/footer.js deleted file mode 100644 index 6858d261..00000000 --- a/mindplot/src/main/javascript/footer.js +++ /dev/null @@ -1,5 +0,0 @@ -try { - $(document).trigger('loadcomplete', 'mind'); -} catch (e) { - console.error(e.stack); -} diff --git a/mindplot/src/main/javascript/header.js b/mindplot/src/main/javascript/header.js deleted file mode 100644 index ed9280ad..00000000 --- a/mindplot/src/main/javascript/header.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -var mindplot = {}; -mindplot.util = {}; -mindplot.commands = {}; -mindplot.layout = {}; -mindplot.layout.boards = {}; -mindplot.layout.boards.original = {}; -mindplot.widget = {}; -mindplot.model = {}; -mindplot.collaboration = {}; -mindplot.collaboration.framework = {}; -mindplot.persistence = {}; - -mindplot.layout = {}; - -Class.Mutators.Static = function (items) { - this.extend(items); -}; - diff --git a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js b/mindplot/src/main/javascript/layout/AbstractBasicSorter.js deleted file mode 100644 index c0df23c9..00000000 --- a/mindplot/src/main/javascript/layout/AbstractBasicSorter.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -/** - * @class - * @extends mindplot.layout.ChildrenSorterStrategy - */ -mindplot.layout.AbstractBasicSorter = new Class(/** @lends AbstractBasicSorter */{ - Extends: mindplot.layout.ChildrenSorterStrategy, - - /** - * @param {} treeSet - * @param {} node - * @return the height of a node and its children if existing and not shrunken - */ - computeChildrenIdByHeights: function(treeSet, node) { - var result = {}; - this._computeChildrenHeight(treeSet, node, result); - return result; - }, - - _getVerticalPadding: function() { - return mindplot.layout.AbstractBasicSorter.INTERNODE_VERTICAL_PADDING; - }, - - _computeChildrenHeight : function(treeSet, node, heightCache) { - var height = node.getSize().height + (this._getVerticalPadding() * 2); // 2* Top and down padding; - - var result; - var children = treeSet.getChildren(node); - if (children.length == 0 || node.areChildrenShrunken()) { - result = height; - } else { - var childrenHeight = 0; - _.each(children, function(child) { - childrenHeight += this._computeChildrenHeight(treeSet, child, heightCache); - }, this); - - result = Math.max(height, childrenHeight); - } - - if (heightCache) { - heightCache[node.getId()] = result; - } - - return result; - }, - - _getSortedChildren:function(treeSet, node) { - var result = treeSet.getChildren(node); - result.sort(function(a, b) { - return a.getOrder() - b.getOrder() - }); - return result; - }, - - _getRelativeDirection: function(reference, position) { - var offset = position.x - reference.x; - return offset >= 0 ? 1 : -1; - } - -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.AbstractBasicSorter.INTERNODE_VERTICAL_PADDING = 5; -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.AbstractBasicSorter.INTERNODE_HORIZONTAL_PADDING = 30; \ No newline at end of file diff --git a/mindplot/src/main/javascript/layout/BalancedSorter.js b/mindplot/src/main/javascript/layout/BalancedSorter.js deleted file mode 100644 index f9d881f0..00000000 --- a/mindplot/src/main/javascript/layout/BalancedSorter.js +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.BalancedSorter = new Class(/** @lends BalancedSorter */{ - Extends:mindplot.layout.AbstractBasicSorter, - /** - * @constructs - * @extends mindplot.layout.AbstractBasicSorter - */ - initialize:function () { - - }, - - /** - * @param {} graph - * @param {} parent - * @param {} node - * @param {} position - * @param {Boolean} free - * @return an array with order and position - */ - predict:function (graph, parent, node, position, free) { - // If its a free node... - if (free) { - $assert($defined(position), "position cannot be null for predict in free positioning"); - $assert($defined(node), "node cannot be null for predict in free positioning"); - - var rootNode = graph.getRootNode(parent); - var direction = this._getRelativeDirection(rootNode.getPosition(), node.getPosition()); - - var limitXPos = parent.getPosition().x + direction * (parent.getSize().width / 2 + node.getSize().width / 2 + mindplot.layout.BalancedSorter.INTERNODE_HORIZONTAL_PADDING); - - var xPos = direction > 0 ? - (position.x >= limitXPos ? position.x : limitXPos) : - (position.x <= limitXPos ? position.x : limitXPos); - - return [0, {x:xPos, y:position.y}]; - } - - var rootNode = graph.getRootNode(parent); - - // If it is a dragged node... - if (node) { - $assert($defined(position), "position cannot be null for predict in dragging"); - var nodeDirection = this._getRelativeDirection(rootNode.getPosition(), node.getPosition()); - var positionDirection = this._getRelativeDirection(rootNode.getPosition(), position); - var siblings = graph.getSiblings(node); - - var sameParent = parent == graph.getParent(node); - if (siblings.length == 0 && nodeDirection == positionDirection && sameParent) { - return [node.getOrder(), node.getPosition()]; - } - } - - if (!position) { - var right = this._getChildrenForOrder(parent, graph, 0); - var left = this._getChildrenForOrder(parent, graph, 1); - } - // Filter nodes on one side.. - var order = position ? (position.x > rootNode.getPosition().x ? 0 : 1) : ((right.length - left.length) > 0 ? 1 : 0); - var direction = order % 2 == 0 ? 1 : -1; - - // Exclude the dragged node (if set) - var children = this._getChildrenForOrder(parent, graph, order).filter(function (child) { - return child != node; - }); - - // No children? - if (children.length == 0) { - return [order, {x:parent.getPosition().x + direction * (parent.getSize().width / 2 + mindplot.layout.BalancedSorter.INTERNODE_HORIZONTAL_PADDING * 2), y:parent.getPosition().y}]; - } - - // Try to fit within ... - var result = null; - var last = children.getLast(); - position = position || {x:last.getPosition().x, y:last.getPosition().y + 1}; - _.each(children, function (child, index) { - var cpos = child.getPosition(); - if (position.y > cpos.y) { - yOffset = child == last ? - child.getSize().height + mindplot.layout.BalancedSorter.INTERNODE_VERTICAL_PADDING * 2 : - (children[index + 1].getPosition().y - child.getPosition().y) / 2; - result = [child.getOrder() + 2, {x:cpos.x, y:cpos.y + yOffset}]; - } - }); - - // Position wasn't below any node, so it must be inserted above - if (!result) { - var first = children[0]; - result = [position.x > 0 ? 0 : 1, { - x:first.getPosition().x, - y:first.getPosition().y - first.getSize().height - mindplot.layout.BalancedSorter.INTERNODE_VERTICAL_PADDING * 2 - }]; - } - - return result; - }, - - /** - * @param {} treeSet - * @param {} parent - * @param {} child - * @param {} order - */ - insert:function (treeSet, parent, child, order) { - var children = this._getChildrenForOrder(parent, treeSet, order); - - // If no children, return 0 or 1 depending on the side - if (children.length == 0) { - child.setOrder(order % 2); - return; - } - - // Shift all the elements by two, so side is the same. - // In case of balanced sorter, order don't need to be continuous... - var max = 0; - for (var i = 0; i < children.length; i++) { - var node = children[i]; - max = Math.max(max, node.getOrder()); - if (node.getOrder() >= order) { - max = Math.max(max, node.getOrder() + 2); - node.setOrder(node.getOrder() + 2); - } - } - - var newOrder = order > (max + 1) ? (max + 2) : order; - child.setOrder(newOrder); - }, - - /** - * @param {} treeSet - * @param {} node - */ - detach:function (treeSet, node) { - var parent = treeSet.getParent(node); - // Filter nodes on one side.. - var children = this._getChildrenForOrder(parent, treeSet, node.getOrder()); - - _.each(children, function (child, index) { - if (child.getOrder() > node.getOrder()) { - child.setOrder(child.getOrder() - 2); - } - }); - node.setOrder(node.getOrder() % 2 == 0 ? 0 : 1); - }, - - /** - * @param {} treeSet - * @param {} node - * @return offsets - */ - computeOffsets:function (treeSet, node) { - $assert(treeSet, "treeSet can no be null."); - $assert(node, "node can no be null."); - - var children = this._getSortedChildren(treeSet, node); - - // Compute heights ... - var heights = children.map( - function (child) { - return {id:child.getId(), order:child.getOrder(), width:child.getSize().width, height:this._computeChildrenHeight(treeSet, child)}; - }, this).reverse(); - - - // Compute the center of the branch ... - var totalPHeight = 0; - var totalNHeight = 0; - - _.each(heights, function (elem) { - if (elem.order % 2 == 0) { - totalPHeight += elem.height; - } else { - totalNHeight += elem.height; - } - }); - var psum = totalPHeight / 2; - var nsum = totalNHeight / 2; - var ysum = 0; - - // Calculate the offsets ... - var result = {}; - for (var i = 0; i < heights.length; i++) { - var direction = heights[i].order % 2 ? -1 : 1; - - if (direction > 0) { - psum = psum - heights[i].height; - ysum = psum; - } else { - nsum = nsum - heights[i].height; - ysum = nsum; - } - - var yOffset = ysum + heights[i].height / 2; - var xOffset = direction * (node.getSize().width / 2 + heights[i].width / 2 + +mindplot.layout.BalancedSorter.INTERNODE_HORIZONTAL_PADDING); - - $assert(!isNaN(xOffset), "xOffset can not be null"); - $assert(!isNaN(yOffset), "yOffset can not be null"); - - result[heights[i].id] = {x:xOffset, y:yOffset}; - } - return result; - }, - - /** - * @param {} treeSet - * @param {} node - * @throw will throw an error if order elements are missing - */ - verify:function (treeSet, node) { - // Check that all is consistent ... - var children = this._getChildrenForOrder(node, treeSet, node.getOrder()); - - // All odd ordered nodes should be "continuous" by themselves - // All even numbered nodes should be "continuous" by themselves - var factor = node.getOrder() % 2 == 0 ? 2 : 1; - for (var i = 0; i < children.length; i++) { - var order = i == 0 && factor == 1 ? 1 : (factor * i); - $assert(children[i].getOrder() == order, "Missing order elements. Missing order: " + (i * factor) + ". Parent:" + node.getId() + ",Node:" + children[i].getId()); - } - }, - - /** - * @param {} treeSet - * @param {} child - * @return the direction of the child within the treeSet - */ - getChildDirection:function (treeSet, child) { - return child.getOrder() % 2 == 0 ? 1 : -1; - }, - - /** - * @return {String} the print name of this class - */ - toString:function () { - return "Balanced Sorter"; - }, - - _getChildrenForOrder:function (parent, graph, order) { - return this._getSortedChildren(graph, parent).filter(function (child) { - return child.getOrder() % 2 == order % 2; - }); - }, - - _getVerticalPadding:function () { - return mindplot.layout.BalancedSorter.INTERNODE_VERTICAL_PADDING; - } -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.BalancedSorter.INTERNODE_VERTICAL_PADDING = 5; -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.BalancedSorter.INTERNODE_HORIZONTAL_PADDING = 30; diff --git a/mindplot/src/main/javascript/layout/ChangeEvent.js b/mindplot/src/main/javascript/layout/ChangeEvent.js deleted file mode 100644 index fb03e07c..00000000 --- a/mindplot/src/main/javascript/layout/ChangeEvent.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.ChangeEvent = new Class(/** @lends ChangeEvent */{ - /** - * @constructs - * @param {} id - * @throws will throw an error if the given id is not/cannot be converted to a numerical value - */ - initialize:function(id) { - $assert(!isNaN(id), "id can not be null"); - this._id = id; - this._position = null; - this._order = null; - }, - - /** @return id */ - getId:function() { - return this._id; - }, - - /** @return order */ - getOrder: function() { - return this._order; - }, - - /** @return position */ - getPosition: function() { - return this._position; - }, - - /** - * @param {} value the order to set - * @throws will throw an error if the given parameter is not/cannot be converted to a numerical - * value - */ - setOrder: function(value) { - $assert(!isNaN(value), "value can not be null"); - this._order = value; - }, - - /** @param {} value - * @throws will throw an error if the value is null or undefined*/ - setPosition: function(value) { - $assert(value, "value can not be null"); - this._position = value; - }, - - /** @return {String} order and position */ - toString: function() { - return "[order:" + this.getOrder() + ", position: {" + this.getPosition().x + "," + this.getPosition().y + "}]"; - } -}); - - diff --git a/mindplot/src/main/javascript/layout/ChildrenSorterStrategy.js b/mindplot/src/main/javascript/layout/ChildrenSorterStrategy.js deleted file mode 100644 index d60edb12..00000000 --- a/mindplot/src/main/javascript/layout/ChildrenSorterStrategy.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.ChildrenSorterStrategy = new Class(/** @lends ChildrenSorterStrategy */{ - /** - * @constructs - */ - initialize:function() { - - }, - - /** @abstract */ - computeChildrenIdByHeights: function(treeSet, node) { - throw "Method must be implemented"; - }, - - /** @abstract */ - computeOffsets:function(treeSet, node) { - throw "Method must be implemented"; - }, - - /** @abstract */ - insert: function(treeSet, parent, child, order) { - throw "Method must be implemented"; - }, - - /** @abstract */ - detach:function(treeSet, node) { - throw "Method must be implemented"; - }, - - /** @abstract */ - predict:function(treeSet, parent, node, position, free) { - throw "Method must be implemented"; - }, - - /** @abstract */ - verify:function(treeSet, node) { - throw "Method must be implemented"; - }, - - /** @abstract */ - getChildDirection: function(treeSet, node) { - throw "Method must be implemented"; - }, - - /** @abstract */ - toString:function() { - throw "Method must be implemented: print name"; - } - -}); - diff --git a/mindplot/src/main/javascript/layout/EventBus.js b/mindplot/src/main/javascript/layout/EventBus.js deleted file mode 100644 index 73ac7ee1..00000000 --- a/mindplot/src/main/javascript/layout/EventBus.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.EventBus = new Class(/** @lends EventBus */{ - Implements: mindplot.Events, - /** - * @constructs - * @implements mindplot.Events - */ - initialize: function() { - } -}); - -/** - * Enum for events - * @enum {String} - */ -mindplot.EventBus.events = { - NodeResizeEvent:'NodeResizeEvent', - NodeMoveEvent:'NodeMoveEvent', - NodeShrinkEvent:'NodeShrinkEvent', - NodeConnectEvent:'NodeConnectEvent', - NodeDisconnectEvent:'NodeDisconnectEvent', - NodeAdded:'NodeAdded', - NodeRemoved:'NodeRemoved', - DoLayout:'DoLayout' -}; - -/** instance */ -mindplot.EventBus.instance = new mindplot.EventBus(); \ No newline at end of file diff --git a/mindplot/src/main/javascript/layout/EventBusDispatcher.js b/mindplot/src/main/javascript/layout/EventBusDispatcher.js deleted file mode 100644 index bb1dd6ed..00000000 --- a/mindplot/src/main/javascript/layout/EventBusDispatcher.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.EventBusDispatcher = new Class(/** @lends EventBusDispatcher */{ - /** - * @constructs - */ - initialize:function() { - this.registerBusEvents(); - }, - - /** - * @param {mindplot.layout.LayoutManager} layoutManager - */ - setLayoutManager : function(layoutManager) { - this._layoutManager = layoutManager; - }, - - /** - * register bus events - */ - registerBusEvents:function () { - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeAdded, this._nodeAdded.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeRemoved, this._nodeRemoved.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeResizeEvent, this._nodeResizeEvent.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeMoveEvent, this._nodeMoveEvent.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeDisconnectEvent, this._nodeDisconnectEvent.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeConnectEvent, this._nodeConnectEvent.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.NodeShrinkEvent, this._nodeShrinkEvent.bind(this)); - mindplot.EventBus.instance.addEvent(mindplot.EventBus.events.DoLayout, this._doLayout.bind(this)); - }, - - _nodeResizeEvent: function(args) { - this._layoutManager.updateNodeSize(args.node.getId(), args.size); - }, - - _nodeMoveEvent: function(args) { - this._layoutManager.moveNode(args.node.getId(), args.position); - }, - - _nodeDisconnectEvent: function(node) { - this._layoutManager.disconnectNode(node.getId()); - }, - - _nodeConnectEvent: function(args) { - this._layoutManager.connectNode(args.parentNode.getId(), args.childNode.getId(), args.childNode.getOrder()); - - }, - - _nodeShrinkEvent: function(node) { - this._layoutManager.updateShrinkState(node.getId(), node.areChildrenShrunken()); - }, - - _nodeAdded: function(node) { - // Central topic must not be added twice ... - if (node.getId() != 0) { - this._layoutManager.addNode(node.getId(), {width:10,height:10}, node.getPosition()); - this._layoutManager.updateShrinkState(node.getId(), node.areChildrenShrunken()); - } - }, - - _nodeRemoved: function(node) { - this._layoutManager.removeNode(node.getId()); - }, - - _doLayout: function() { -// (function() { - this._layoutManager.layout(true); -// console.log("---------"); -// this._layoutManager.dump(); -// console.log("---------"); -// console.log("---------"); -// }).delay(0, this); - }, - - /** @return layout manager */ - getLayoutManager: function() { - return this._layoutManager; - } - -}); \ No newline at end of file diff --git a/mindplot/src/main/javascript/layout/GridSorter.js b/mindplot/src/main/javascript/layout/GridSorter.js deleted file mode 100644 index 8ccfba94..00000000 --- a/mindplot/src/main/javascript/layout/GridSorter.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -/** - * @class - * @extends mindplot.layout.AbstractBasicSorter - */ -mindplot.layout.GridSorter = new Class(/** @lends GridSorter */{ - Extends: mindplot.layout.AbstractBasicSorter, - - /** - * @param {} treeSet - * @param {} node - * @return offsets - */ - computeOffsets: function(treeSet, node) { - $assert(treeSet, "treeSet can no be null."); - $assert(node, "node can no be null."); - $assert("order can no be null."); - - var children = this._getSortedChildren(treeSet, node); - - // Compute heights ... - var me = this; - var heights = children.map(function(child) { - return { - id: child.getId(), - height: me._computeChildrenHeight(treeSet, child) - }; - }); - - // Calculate the offsets ... - var result = {}; - for (var i = 0; i < heights.length; i++) { - var even = i%2 == 0 ? 1 : -1; - - var zeroHeight = i == 0 ? 0 : heights[0].height/2 * even; - var middleHeight = 0; - for (var j=i-2; j>0; j=j-2) { - middleHeight += heights[j].height * even; - } - var finalHeight = i == 0 ? 0 : heights[i].height/2 * even; - - var yOffset = zeroHeight + middleHeight +finalHeight; - var xOffset = node.getSize().width + mindplot.layout.GridSorter.GRID_HORIZONTAR_SIZE; - - $assert(!isNaN(xOffset), "xOffset can not be null"); - $assert(!isNaN(yOffset), "yOffset can not be null"); - - result[heights[i].id] = {x:xOffset,y:yOffset}; - - } - return result; - }, - - /** - * @return {String} the print name of this class - */ - toString:function() { - return "Grid Sorter"; - } - -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.GridSorter.GRID_HORIZONTAR_SIZE = 20; -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.GridSorter.INTER_NODE_VERTICAL_DISTANCE = 50; - diff --git a/mindplot/src/main/javascript/layout/LayoutManager.js b/mindplot/src/main/javascript/layout/LayoutManager.js deleted file mode 100644 index dabeb4b4..00000000 --- a/mindplot/src/main/javascript/layout/LayoutManager.js +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.LayoutManager = new Class(/** @lends LayoutManager */{ - Extends: mindplot.Events, - /** - * @constructs - * @extends mindplot.Events - * @param {} rootNodeId - * @param {} rootSize - * @throws will throw an error if the root node id is null or undefined - * @throws will throw an error if the root size is null - */ - initialize: function(rootNodeId, rootSize) { - $assert($defined(rootNodeId), "rootNodeId can not be null"); - $assert(rootSize, "rootSize can not be null"); - var position = position || {x:0, y:0}; - - this._treeSet = new mindplot.layout.RootedTreeSet(); - this._layout = new mindplot.layout.OriginalLayout(this._treeSet); - - var rootNode = this._layout.createNode(rootNodeId, rootSize, position, 'root'); - this._treeSet.setRoot(rootNode); - this._events = []; - }, - - /** - * @param id - * @param size - * @throws will throw an error if id is null or undefined - */ - updateNodeSize: function(id, size) { - $assert($defined(id), "id can not be null"); - - var node = this._treeSet.find(id); - node.setSize(size); - }, - - /** - * @param id - * @param value - * @throws will throw an error if id is null or undefined - * @throws will throw an error if value is null or undefined - * @return this - */ - updateShrinkState: function(id, value) { - $assert($defined(id), "id can not be null"); - $assert($defined(value), "value can not be null"); - - var node = this._treeSet.find(id); - node.setShrunken(value); - - return this; - }, - - /** - * @param id - * @return {@link RootedTreeSet}.find(id) - */ - find: function(id) { - return this._treeSet.find(id); - }, - - /** - * @param id - * @param position - * @throws will throw an error if id is null or undefined - * @throws will throw an error if position is null or undefined - * @throws will throw an error if the position's x property is null or undefined - * @throws will throw an error if the position's y property is null or undefined - */ - moveNode: function(id, position) { - $assert($defined(id), "id cannot be null"); - $assert($defined(position), "position cannot be null"); - $assert($defined(position.x), "x can not be null"); - $assert($defined(position.y), "y can not be null"); - - var node = this._treeSet.find(id); - // @Todo: this should not be here. This is broking the isolated node support... -// node.setFree(true); -// node.setFreeDisplacement({x:position.x - node.getPosition().x, y:position.y - node.getPosition().y}); - node.setPosition(position); - }, - - /** - * @param parentId - * @param childId - * @param order - * @throws will throw an error if parentId is null or undefined - * @throws will throw an error if childId is null or undefined - * @throws will throw an error if order is null or undefined - * @return this - */ - connectNode: function(parentId, childId, order) { - $assert($defined(parentId), "parentId cannot be null"); - $assert($defined(childId), "childId cannot be null"); - $assert($defined(order), "order cannot be null"); - - this._layout.connectNode(parentId, childId, order); - - return this; - }, - - /** - * @param id - * @throws will throw an error if id is null or undefined - * @return this - */ - disconnectNode: function(id) { - $assert($defined(id), "id can not be null"); - this._layout.disconnectNode(id); - - return this; - }, - - /** - * @param id - * @param size - * @param position - * @throws will throw an error if id is null or undefined - * @return this - */ - addNode:function(id, size, position) { - $assert($defined(id), "id can not be null"); - var result = this._layout.createNode(id, size, position, 'topic'); - this._treeSet.add(result); - - return this; - }, - - /** - * removes a node and its connection to parent if existing - * @param id - * @throws will throw an error if id is null or undefined - * @return this - */ - removeNode: function(id) { - $assert($defined(id), "id can not be null"); - var node = this._treeSet.find(id); - - // Is It connected ? - if (this._treeSet.getParent(node)) { - this.disconnectNode(id); - } - - // Remove the all the branch ... - this._treeSet.remove(id); - - return this; - }, - - /** - * @param {Number} parentId - * @param {Number=} nodeId - * @param {String=} position the position to use as mindplot.layout.Node.properties position - * property as '(x,y)' - * @param {Boolean=} free true specifies free node positioning - * @throws will throw an error if parentId is null or undefined - */ - predict: function(parentId, nodeId, position, free) { - $assert($defined(parentId), "parentId can not be null"); - - var parent = this._treeSet.find(parentId); - var node = nodeId ? this._treeSet.find(nodeId) : null; - var sorter = parent.getSorter(); - - var result = sorter.predict(this._treeSet, parent, node, position, free); - return {order:result[0],position:result[1]}; - }, - - /** - * logs dump to console - */ - dump: function() { - console.log(this._treeSet.dump()); - }, - - /** - * @param containerId - * @param {width:Number, height:Number} size - * @throws will throw an error if containerId is null or undefined - * @return canvas - */ - plot: function(containerId, size) { - $assert(containerId, "containerId cannot be null"); - size = size || {width:200,height:200}; - var squaresize = 10; - var canvas = Raphael(containerId, size.width, size.height); - canvas.drawGrid(0, 0, size.width, size.height, size.width / squaresize, size.height / squaresize); - this._treeSet.plot(canvas); - - return canvas; - }, - - /** - * initializes the layout to be updated - * @param fireEvents - * @return this - */ - layout: function(fireEvents) { - // File repositioning ... - this._layout.layout(); - - // Collect changes ... - this._collectChanges(); - - if ($(fireEvents).length>0 || fireEvents) { - this._flushEvents(); - } - - return this; - }, - - _flushEvents: function() { - _.each(this._events, function(event) { - this.fireEvent('change', event); - }, this); - this._events = []; - }, - - _collectChanges: function(nodes) { - if (!nodes) - nodes = this._treeSet.getTreeRoots(); - - _.each(nodes, function(node) { - if (node.hasOrderChanged() || node.hasPositionChanged()) { - - // Find or create a event ... - var id = node.getId(); - var event = this._events.some(function(event) { - return event.id == id; - }); - if (!event) { - event = new mindplot.layout.ChangeEvent(id); - } - - // Update nodes ... - event.setOrder(node.getOrder()); - event.setPosition(node.getPosition()); - - node.resetPositionState(); - node.resetOrderState(); - node.resetFreeState(); - this._events.push(event); - } - this._collectChanges(this._treeSet.getChildren(node)); - }, this); - } - -}); - diff --git a/mindplot/src/main/javascript/layout/Node.js b/mindplot/src/main/javascript/layout/Node.js deleted file mode 100644 index fece5e04..00000000 --- a/mindplot/src/main/javascript/layout/Node.js +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.Node = new Class(/** @lends Node */{ - /** - * @constructs - * @param id - * @param size - * @param position - * @param sorter - * @throws will throw an error if id is not a finite number or is null or undefined - * @throws will throw an error if size is null or undefined - * @throws will throw an error if position is null or undefined - * @throws will throw an error if sorter is null or undefined - */ - initialize:function (id, size, position, sorter) { - $assert(typeof id === 'number' && isFinite(id), "id can not be null"); - $assert(size, "size can not be null"); - $assert(position, "position can not be null"); - $assert(sorter, "sorter can not be null"); - - this._id = id; - this._sorter = sorter; - this._properties = {}; - - this.setSize(size); - this.setPosition(position); - this.setShrunken(false); - }, - - /** */ - getId:function () { - return this._id; - }, - - /** */ - setFree:function (value) { - this._setProperty('free', value); - }, - - /** */ - isFree:function () { - return this._getProperty('free'); - }, - - /** */ - hasFreeChanged:function () { - return this._isPropertyChanged('free'); - }, - - /** */ - hasFreeDisplacementChanged:function () { - return this._isPropertyChanged('freeDisplacement'); - }, - - /** */ - setShrunken:function (value) { - this._setProperty('shrink', value); - }, - - /** */ - areChildrenShrunken:function () { - return this._getProperty('shrink'); - }, - - /** */ - setOrder:function (order) { - $assert(typeof order === 'number' && isFinite(order), "Order can not be null. Value:" + order); - this._setProperty('order', order); - }, - - /** */ - resetPositionState:function () { - var prop = this._properties['position']; - if (prop) { - prop.hasChanged = false; - } - }, - - /** */ - resetOrderState:function () { - var prop = this._properties['order']; - if (prop) { - prop.hasChanged = false; - } - }, - - /** */ - resetFreeState:function () { - var prop = this._properties['freeDisplacement']; - if (prop) { - prop.hasChanged = false; - } - }, - - /** */ - getOrder:function () { - return this._getProperty('order'); - }, - - /** */ - hasOrderChanged:function () { - return this._isPropertyChanged('order'); - }, - - /** */ - hasPositionChanged:function () { - return this._isPropertyChanged('position'); - }, - - /** */ - hasSizeChanged:function () { - return this._isPropertyChanged('size'); - }, - - /** */ - getPosition:function () { - return this._getProperty('position'); - }, - - /** */ - setSize:function (size) { - $assert($defined(size), "Size can not be null"); - this._setProperty('size', Object.clone(size)); - }, - - /** */ - getSize:function () { - return this._getProperty('size'); - }, - - /** */ - setFreeDisplacement:function (displacement) { - $assert($defined(displacement), "Position can not be null"); - $assert($defined(displacement.x), "x can not be null"); - $assert($defined(displacement.y), "y can not be null"); - var oldDisplacement = this.getFreeDisplacement(); - var newDisplacement = {x:oldDisplacement.x + displacement.x, y:oldDisplacement.y + displacement.y}; - - this._setProperty('freeDisplacement', Object.clone(newDisplacement)); - }, - - /** */ - resetFreeDisplacement:function () { - this._setProperty('freeDisplacement', {x:0, y:0}); - }, - - /** */ - getFreeDisplacement:function () { - var freeDisplacement = this._getProperty('freeDisplacement'); - return (freeDisplacement || {x:0, y:0}); - }, - - /** */ - setPosition:function (position) { - $assert($defined(position), "Position can not be null"); - $assert($defined(position.x), "x can not be null"); - $assert($defined(position.y), "y can not be null"); - - // This is a performance improvement to avoid movements that really could be avoided. - var currentPos = this.getPosition(); - if (currentPos == null || Math.abs(currentPos.x - position.x) > 2 || Math.abs(currentPos.y - position.y) > 2) - this._setProperty('position', position); - }, - - _setProperty:function (key, value) { - var prop = this._properties[key]; - if (!prop) { - prop = { - hasChanged:false, - value:null, - oldValue:null - }; - } - - // Only update if the property has changed ... - if (JSON.stringify(prop.value) != JSON.stringify(value)) { - prop.oldValue = prop.value; - prop.value = value; - prop.hasChanged = true; - } - this._properties[key] = prop; - }, - - _getProperty:function (key) { - var prop = this._properties[key]; - return $defined(prop) ? prop.value : null; - }, - - _isPropertyChanged:function (key) { - var prop = this._properties[key]; - return prop ? prop.hasChanged : false; - }, - - /** */ - getSorter:function () { - return this._sorter; - }, - - /** @return {String} returns id, order, position, size and shrink information*/ - toString:function () { - return "[id:" + this.getId() + ", order:" + this.getOrder() + ", position: {" + this.getPosition().x + "," + this.getPosition().y + "}, size: {" + this.getSize().width + "," + this.getSize().height + "}, shrink:" + this.areChildrenShrunken() + "]"; - } - -}); - diff --git a/mindplot/src/main/javascript/layout/OriginalLayout.js b/mindplot/src/main/javascript/layout/OriginalLayout.js deleted file mode 100644 index aadae2a7..00000000 --- a/mindplot/src/main/javascript/layout/OriginalLayout.js +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.OriginalLayout = new Class(/** @lends OriginalLayout */{ - /** - * @constructs - * @param treeSet - */ - initialize:function (treeSet) { - this._treeSet = treeSet; - }, - - /** */ - createNode:function (id, size, position, type) { - $assert($defined(id), "id can not be null"); - $assert(size, "size can not be null"); - $assert(position, "position can not be null"); - $assert(type, "type can not be null"); - - var strategy = type === 'root' ? - mindplot.layout.OriginalLayout.BALANCED_SORTER : - mindplot.layout.OriginalLayout.SYMMETRIC_SORTER; - return new mindplot.layout.Node(id, size, position, strategy); - }, - - /** */ - connectNode:function (parentId, childId, order) { - - var parent = this._treeSet.find(parentId); - var child = this._treeSet.find(childId); - - // Insert the new node ... - var sorter = parent.getSorter(); - sorter.insert(this._treeSet, parent, child, order); - - // Connect the new node ... - this._treeSet.connect(parentId, childId); - - // Fire a basic validation ... - sorter.verify(this._treeSet, parent); - }, - - /** */ - disconnectNode:function (nodeId) { - var node = this._treeSet.find(nodeId); - var parent = this._treeSet.getParent(node); - $assert(parent, "Node already disconnected"); - - // Make it fixed - node.setFree(false); - node.resetFreeDisplacement(); - - // Remove from children list. - var sorter = parent.getSorter(); - sorter.detach(this._treeSet, node); - - // Disconnect the new node ... - this._treeSet.disconnect(nodeId); - - // Fire a basic validation ... - parent.getSorter().verify(this._treeSet, parent); - }, - - /** */ - layout:function () { - var roots = this._treeSet.getTreeRoots(); - _.each(roots, function (node) { - - // Calculate all node heights ... - var sorter = node.getSorter(); - - var heightById = sorter.computeChildrenIdByHeights(this._treeSet, node); - - this._layoutChildren(node, heightById); - - this._fixOverlapping(node, heightById); - }, this); - }, - - _layoutChildren:function (node, heightById) { - - var nodeId = node.getId(); - var children = this._treeSet.getChildren(node); - var parent = this._treeSet.getParent(node); - var childrenOrderMoved = children.some(function (child) { - return child.hasOrderChanged(); - }); - var childrenSizeChanged = children.some(function (child) { - return child.hasSizeChanged(); - }); - - // If ether any of the nodes has been changed of position or the height of the children is not - // the same, children nodes must be repositioned .... - var newBranchHeight = heightById[nodeId]; - - var parentHeightChanged = $defined(parent) ? parent._heightChanged : false; - var heightChanged = node._branchHeight != newBranchHeight; - node._heightChanged = heightChanged || parentHeightChanged; - - if (childrenOrderMoved || childrenSizeChanged || heightChanged || parentHeightChanged) { - var sorter = node.getSorter(); - var offsetById = sorter.computeOffsets(this._treeSet, node); - var parentPosition = node.getPosition(); - var me = this; - _.each(children, function (child) { - var offset = offsetById[child.getId()]; - - var childFreeDisplacement = child.getFreeDisplacement(); - var direction = node.getSorter().getChildDirection(me._treeSet, child); - - if ((direction > 0 && childFreeDisplacement.x < 0) || (direction < 0 && childFreeDisplacement.x > 0)) { - child.resetFreeDisplacement(); - child.setFreeDisplacement({x:-childFreeDisplacement.x, y:childFreeDisplacement.y}); - } - - offset.x += child.getFreeDisplacement().x; - offset.y += child.getFreeDisplacement().y; - - var parentX = parentPosition.x; - var parentY = parentPosition.y; - - var newPos = {x:parentX + offset.x, y:parentY + offset.y + me._calculateAlignOffset(node, child, heightById)}; - me._treeSet.updateBranchPosition(child, newPos); - }); - - node._branchHeight = newBranchHeight; - } - - // Continue reordering the children nodes ... - _.each(children, function (child) { - this._layoutChildren(child, heightById); - }, this); - }, - - _calculateAlignOffset:function (node, child, heightById) { - if (child.isFree()) { - return 0; - } - - var offset = 0; - - var nodeHeight = node.getSize().height; - var childHeight = child.getSize().height; - - if (this._treeSet.isStartOfSubBranch(child) && this._branchIsTaller(child, heightById)) { - if (this._treeSet.hasSinglePathToSingleLeaf(child)) { - offset = heightById[child.getId()] / 2 - (childHeight + child.getSorter()._getVerticalPadding() * 2) / 2; - } else { - offset = this._treeSet.isLeaf(child) ? 0 : -(childHeight - nodeHeight) / 2; - } - } else if (nodeHeight > childHeight) { - if (this._treeSet.getSiblings(child).length > 0) { - offset = 0; - } else { - offset = nodeHeight / 2 - childHeight / 2; - } - } - else if (childHeight > nodeHeight) { - if (this._treeSet.getSiblings(child).length > 0) { - offset = 0; - } else { - offset = -(childHeight / 2 - nodeHeight / 2); - } - } - - return offset; - }, - - _branchIsTaller:function (node, heightById) { - return heightById[node.getId()] > (node.getSize().height + node.getSorter()._getVerticalPadding() * 2); - }, - - _fixOverlapping:function (node, heightById) { - var children = this._treeSet.getChildren(node); - - if (node.isFree()) { - this._shiftBranches(node, heightById); - } - - _.each(children, function (child) { - this._fixOverlapping(child, heightById); - }, this); - }, - - _shiftBranches:function (node, heightById) { - var shiftedBranches = [node]; - - var siblingsToShift = this._treeSet.getSiblingsInVerticalDirection(node, node.getFreeDisplacement().y); - var last = node; - _.each(siblingsToShift, function (sibling) { - var overlappingOccurs = shiftedBranches.some(function (shiftedBranch) { - return this._branchesOverlap(shiftedBranch, sibling, heightById); - }, this); - - if (!sibling.isFree() || overlappingOccurs) { - var sAmount = node.getFreeDisplacement().y; - this._treeSet.shiftBranchPosition(sibling, 0, sAmount); - shiftedBranches.push(sibling); - } - }, this); - - var branchesToShift = this._treeSet.getBranchesInVerticalDirection(node, node.getFreeDisplacement().y).filter(function (branch) { - return !shiftedBranches.contains(branch); - }); - - _.each(branchesToShift, function (branch) { - var bAmount = node.getFreeDisplacement().y; - this._treeSet.shiftBranchPosition(branch, 0, bAmount); - shiftedBranches.push(branch); - last = branch; - }, this); - }, - - _branchesOverlap:function (branchA, branchB, heightById) { - // a branch doesn't really overlap with itself - if (branchA == branchB) { - return false; - } - - var topA = branchA.getPosition().y - heightById[branchA.getId()] / 2; - var bottomA = branchA.getPosition().y + heightById[branchA.getId()] / 2; - var topB = branchB.getPosition().y - heightById[branchB.getId()] / 2; - var bottomB = branchB.getPosition().y + heightById[branchB.getId()] / 2; - - return !(topA >= bottomB || bottomA <= topB); - } - -}); - - -/** - * @type {mindplot.layout.SymmetricSorter} - */ -mindplot.layout.OriginalLayout.SYMMETRIC_SORTER = new mindplot.layout.SymmetricSorter(); -/** - * @type {mindplot.layout.BalancedSorter} - */ -mindplot.layout.OriginalLayout.BALANCED_SORTER = new mindplot.layout.BalancedSorter(); - - - diff --git a/mindplot/src/main/javascript/layout/RootedTreeSet.js b/mindplot/src/main/javascript/layout/RootedTreeSet.js deleted file mode 100644 index 9ff1e546..00000000 --- a/mindplot/src/main/javascript/layout/RootedTreeSet.js +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.RootedTreeSet = new Class(/** @lends RootedTreeSet */{ - /** @constructs */ - initialize:function () { - this._rootNodes = []; - }, - - /** - * @param root - * @throws will throw an error if root is null or undefined - */ - setRoot:function (root) { - $assert(root, 'root can not be null'); - this._rootNodes.push(this._decodate(root)); - }, - - /** getter */ - getTreeRoots:function () { - return this._rootNodes; - }, - - _decodate:function (node) { - node._children = []; - return node; - }, - - /** - * @param {mindplot.model.NodeModel} node - * @throws will throw an error if node is null or undefined - * @throws will throw an error if node with id already exists - * @throws will throw an error if node has been added already - */ - add:function (node) { - $assert(node, 'node can not be null'); - $assert(!this.find(node.getId(), false), 'node already exits with this id. Id:' + node.getId()); - $assert(!node._children, 'node already added'); - this._rootNodes.push(this._decodate(node)); - }, - - - /** - * @param nodeId - * @throws will throw an error if nodeId is null or undefined - */ - remove:function (nodeId) { - $assert($defined(nodeId), 'nodeId can not be null'); - var node = this.find(nodeId); - this._rootNodes.erase(node); - }, - - /** - * @param parentId - * @param childId - * @throws will throw an error if parentId is null or undefined - * @throws will throw an error if childId is null or undefined - * @throws will throw an error if node with id childId is already a child of parent - */ - connect:function (parentId, childId) { - $assert($defined(parentId), 'parent can not be null'); - $assert($defined(childId), 'child can not be null'); - - var parent = this.find(parentId); - var child = this.find(childId, true); - $assert(!child._parent, 'node already connected. Id:' + child.getId() + ",previous:" + child._parent); - - parent._children.push(child); - child._parent = parent; - this._rootNodes.erase(child); - }, - - /** - * @param nodeId - * @throws will throw an error if nodeId is null or undefined - * @throws will throw an error if node is not connected - */ - disconnect:function (nodeId) { - $assert($defined(nodeId), 'nodeId can not be null'); - var node = this.find(nodeId); - $assert(node._parent, "Node is not connected"); - - node._parent._children.erase(node); - this._rootNodes.push(node); - node._parent = null; - }, - - /** - * @param id - * @param validate - * @throws will throw an error if id is null or undefined - * @throws will throw an error if node cannot be found - * @return node - */ - find:function (id, validate) { - $assert($defined(id), 'id can not be null'); - - var graphs = this._rootNodes; - var result = null; - for (var i = 0; i < graphs.length; i++) { - var node = graphs[i]; - result = this._find(id, node); - if (result) { - break; - } - } - validate = !$defined(validate) ? true : validate; - $assert(validate ? result : true, 'node could not be found id:' + id + "\n,RootedTreeSet" + this.dump()); - return result; - - }, - - _find:function (id, parent) { - if (parent.getId() == id) { - return parent; - - } - - var result = null; - var children = parent._children; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - result = this._find(id, child); - if (result) - break; - } - - return result; - }, - - /** - * @param node - * @throws will throw an error if nodeId is null or undefined - * @return children - */ - getChildren:function (node) { - $assert(node, 'node cannot be null'); - return node._children; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return root node or the provided node, if it has no parent - */ - getRootNode:function (node) { - $assert(node, "node cannot be null"); - var parent = this.getParent(node); - if ($defined(parent)) { - return this.getRootNode(parent); - } - - return node; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return {Array} ancestors*/ - getAncestors:function (node) { - $assert(node, 'node cannot be null'); - return this._getAncestors(this.getParent(node), []); - }, - - _getAncestors:function (node, ancestors) { - var result = ancestors; - if (node) { - result.push(node); - this._getAncestors(this.getParent(node), result); - } - return result; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return {Array} siblings - */ - getSiblings:function (node) { - $assert(node, 'node cannot be null'); - if (!$defined(node._parent)) { - return []; - } - var siblings = node._parent._children.filter(function (child) { - return child != node; - }); - return siblings; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return {Boolean} whether the node has a single path to a single leaf (no branching) - */ - hasSinglePathToSingleLeaf:function (node) { - $assert(node, 'node cannot be null'); - return this._hasSinglePathToSingleLeaf(node); - }, - - _hasSinglePathToSingleLeaf:function (node) { - var children = this.getChildren(node); - - if (children.length == 1) { - return this._hasSinglePathToSingleLeaf(children[0]); - } - - return children.length == 0; - }, - - /** - * @param node - * @return {Boolean} whether the node is the start of a subbranch*/ - isStartOfSubBranch:function (node) { - return this.getSiblings(node).length > 0 && this.getChildren(node).length == 1; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return {Boolean} whether the node is a leaf - */ - isLeaf:function (node) { - $assert(node, 'node cannot be null'); - return this.getChildren(node).length == 0; - }, - - /** - * @param node - * @throws will throw an error if node is null or undefined - * @return parent - */ - getParent:function (node) { - $assert(node, 'node cannot be null'); - return node._parent; - }, - - /** - * @return result - */ - dump:function () { - var branches = this._rootNodes; - var result = ""; - for (var i = 0; i < branches.length; i++) { - var branch = branches[i]; - result += this._dump(branch, ""); - } - return result; - }, - - _dump:function (node, indent) { - var result = indent + node + "\n"; - var children = this.getChildren(node); - for (var i = 0; i < children.length; i++) { - var child = children[i]; - result += this._dump(child, indent + " "); - } - - return result; - }, - - /** - * @param canvas - */ - plot:function (canvas) { - var branches = this._rootNodes; - for (var i = 0; i < branches.length; i++) { - var branch = branches[i]; - this._plot(canvas, branch); - } - }, - - _plot:function (canvas, node, root) { - var children = this.getChildren(node); - var cx = node.getPosition().x + canvas.width / 2 - node.getSize().width / 2; - var cy = node.getPosition().y + canvas.height / 2 - node.getSize().height / 2; - var rect = canvas.rect(cx, cy, node.getSize().width, node.getSize().height); - var order = node.getOrder() == null ? "r" : node.getOrder(); - var text = canvas.text(node.getPosition().x + canvas.width / 2, node.getPosition().y + canvas.height / 2, node.getId() + "[" + order + "]"); - text.attr('fill', '#FFF'); - var fillColor = this._rootNodes.contains(node) ? "#000" : (node.isFree() ? "#abc" : "#c00"); - rect.attr('fill', fillColor); - - var rectPosition = {x:rect.attr("x") - canvas.width / 2 + rect.attr("width") / 2, y:rect.attr("y") - canvas.height / 2 + rect.attr("height") / 2}; - var rectSize = {width:rect.attr("width"), height:rect.attr("height")}; - rect.click(function () { - console.log("[id:" + node.getId() + ", order:" + node.getOrder() + ", position:(" + rectPosition.x + "," + rectPosition.y + "), size:" + rectSize.width + "x" + rectSize.height + ", freeDisplacement:(" + node.getFreeDisplacement().x + "," + node.getFreeDisplacement().y + ")]"); - }); - text.click(function () { - console.log("[id:" + node.getId() + ", order:" + node.getOrder() + ", position:(" + rectPosition.x + "," + rectPosition.y + "), size:" + rectSize.width + "x" + rectSize.height + ", freeDisplacement:(" + node.getFreeDisplacement().x + "," + node.getFreeDisplacement().y + ")]"); - }); - - for (var i = 0; i < children.length; i++) { - var child = children[i]; - this._plot(canvas, child); - } - }, - - /** - * @param node - * @param position - */ - updateBranchPosition:function (node, position) { - - var oldPos = node.getPosition(); - node.setPosition(position); - - var xOffset = oldPos.x - position.x; - var yOffset = oldPos.y - position.y; - - var children = this.getChildren(node); - var me = this; - _.each(children, function (child) { - me.shiftBranchPosition(child, xOffset, yOffset); - }); - - }, - - /** - * @param node - * @param xOffset - * @param yOffset - */ - shiftBranchPosition:function (node, xOffset, yOffset) { - var position = node.getPosition(); - node.setPosition({x:position.x + xOffset, y:position.y + yOffset}); - - var children = this.getChildren(node); - var me = this; - _.each(children, function (child) { - me.shiftBranchPosition(child, xOffset, yOffset); - }); - }, - - /** - * @param node - * @param yOffset - * @return siblings in the offset (vertical) direction, i.e. with lower or higher order, respectively - */ - getSiblingsInVerticalDirection:function (node, yOffset) { - // siblings with lower or higher order, depending on the direction of the offset and on the same side as their parent - var parent = this.getParent(node); - var siblings = this.getSiblings(node).filter(function (sibling) { - var sameSide = node.getPosition().x > parent.getPosition().x ? sibling.getPosition().x > parent.getPosition().x : sibling.getPosition().x < parent.getPosition().x; - var orderOK = yOffset < 0 ? sibling.getOrder() < node.getOrder() : sibling.getOrder() > node.getOrder(); - return orderOK && sameSide; - }); - - if (yOffset < 0) { - siblings.reverse(); - } - - return siblings; - }, - - /** - * @param node - * @param yOffset - * @return branches of the root node on the same side as the given node's, in the given - * vertical direction - */ - getBranchesInVerticalDirection:function (node, yOffset) { - // direct descendants of the root that do not contain the node and are on the same side - // and on the direction of the offset - var rootNode = this.getRootNode(node); - var branches = this.getChildren(rootNode).filter(function (child) { - return this._find(node.getId(), child); - }, this); - - var branch = branches[0]; - var rootDescendants = this.getSiblings(branch).filter(function (sibling) { - var sameSide = node.getPosition().x > rootNode.getPosition().x ? sibling.getPosition().x > rootNode.getPosition().x : sibling.getPosition().x < rootNode.getPosition().x; - var sameDirection = yOffset < 0 ? sibling.getOrder() < branch.getOrder() : sibling.getOrder() > branch.getOrder(); - return sameSide && sameDirection; - }, this); - - return rootDescendants; - } - -}); - diff --git a/mindplot/src/main/javascript/layout/SymmetricSorter.js b/mindplot/src/main/javascript/layout/SymmetricSorter.js deleted file mode 100644 index fefd778e..00000000 --- a/mindplot/src/main/javascript/layout/SymmetricSorter.js +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright [2015] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * 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. - */ - -mindplot.layout.SymmetricSorter = new Class(/** @lends SymmetricSorter */{ - Extends:mindplot.layout.AbstractBasicSorter, - /** - * @constructs - * @extends mindplot.layout.AbstractBasicSorter - */ - initialize:function () { - - }, - - /** - * Predict the order and position of a dragged node. - * - * @param graph The tree set - * @param parent The parent of the node - * @param node The node - * @param position The position of the drag - * @param free Free drag or not - * @return {*} - */ - predict:function (graph, parent, node, position, free) { - - var self = this; - var rootNode = graph.getRootNode(parent); - - // If its a free node... - if (free) { - $assert($defined(position), "position cannot be null for predict in free positioning"); - $assert($defined(node), "node cannot be null for predict in free positioning"); - - var direction = this._getRelativeDirection(rootNode.getPosition(), parent.getPosition()); - var limitXPos = parent.getPosition().x + direction * (parent.getSize().width / 2 + node.getSize().width / 2 + mindplot.layout.SymmetricSorter.INTERNODE_HORIZONTAL_PADDING); - - var xPos = direction > 0 ? - (position.x >= limitXPos ? position.x : limitXPos) : - (position.x <= limitXPos ? position.x : limitXPos); - - return [0, {x:xPos, y:position.y}]; - } - - // Its not a dragged node (it is being added) - if (!node) { - var parentDirection = self._getRelativeDirection(rootNode.getPosition(), parent.getPosition()); - var position = { - x:parent.getPosition().x + parentDirection * (parent.getSize().width + mindplot.layout.SymmetricSorter.INTERNODE_HORIZONTAL_PADDING), - y:parent.getPosition().y - }; - return [graph.getChildren(parent).length, position]; - } - - // If it is a dragged node... - $assert($defined(position), "position cannot be null for predict in dragging"); - var nodeDirection = this._getRelativeDirection(rootNode.getPosition(), node.getPosition()); - var positionDirection = this._getRelativeDirection(rootNode.getPosition(), position); - var siblings = graph.getSiblings(node); - - // node has no siblings and its trying to reconnect to its own parent - var sameParent = parent == graph.getParent(node); - if (siblings.length == 0 && nodeDirection == positionDirection && sameParent) { - return [node.getOrder(), node.getPosition()]; - } - - var parentChildren = graph.getChildren(parent); - - if (parentChildren.length == 0) { - // Fit as a child of the parent node... - var position = { - x:parent.getPosition().x + positionDirection * (parent.getSize().width + mindplot.layout.SymmetricSorter.INTERNODE_HORIZONTAL_PADDING), - y:parent.getPosition().y - }; - return [0, position]; - } else { - // Try to fit within ... - var result = null; - var last = parentChildren.getLast(); - for (var i = 0; i < parentChildren.length; i++) { - var parentChild = parentChildren[i]; - var nodeAfter = (i + 1) == parentChild.length ? null : parentChildren[i + 1]; - - // Fit at the bottom - if (!nodeAfter && position.y > parentChild.getPosition().y) { - var order = (graph.getParent(node) && graph.getParent(node).getId() == parent.getId()) ? - last.getOrder() : last.getOrder() + 1; - var position = { - x:parentChild.getPosition().x, - y:parentChild.getPosition().y + parentChild.getSize().height + mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING * 2 - }; - return [order, position]; - } - - // Fit after this node - if (nodeAfter && position.y > parentChild.getPosition().y && position.y < nodeAfter.getPosition().y) { - if (nodeAfter.getId() == node.getId() || parentChild.getId() == node.getId()) { - return [node.getOrder(), node.getPosition()]; - } else { - var order = position.y > node.getPosition().y ? - nodeAfter.getOrder() - 1 : parentChild.getOrder() + 1; - var position = { - x:parentChild.getPosition().x, - y:parentChild.getPosition().y + (nodeAfter.getPosition().y - parentChild.getPosition().y) / 2 - }; - - return [order, position]; - } - } - } - } - - // Position wasn't below any node, so it must be fitted above the first - var first = parentChildren[0]; - var position = { - x:first.getPosition().x, - y:first.getPosition().y - first.getSize().height - mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING * 2 - }; - return [0, position]; - }, - - /** - * @param treeSet - * @param parent - * @param child - * @param order - * @throws will throw an error if the order is not strictly continuous - */ - insert:function (treeSet, parent, child, order) { - var children = this._getSortedChildren(treeSet, parent); - $assert(order <= children.length, "Order must be continues and can not have holes. Order:" + order); - - // Shift all the elements in one . - for (var i = order; i < children.length; i++) { - var node = children[i]; - node.setOrder(i + 1); - } - child.setOrder(order); - }, - - /** - * @param treeSet - * @param node - * @throws will throw an error if the node is in the wrong position*/ - detach:function (treeSet, node) { - var parent = treeSet.getParent(node); - var children = this._getSortedChildren(treeSet, parent); - var order = node.getOrder(); - $assert(children[order] === node, "Node seems not to be in the right position"); - - // Shift all the nodes ... - for (var i = node.getOrder() + 1; i < children.length; i++) { - var child = children[i]; - child.setOrder(child.getOrder() - 1); - } - node.setOrder(0); - }, - - /** - * @param treeSet - * @param node - * @throws will throw an error if treeSet is null or undefined - * @throws will throw an error if node is null or undefined - * @throws will throw an error if the calculated x offset cannot be converted to a numeric - * value, is null or undefined - * @throws will throw an error if the calculated y offset cannot be converted to a numeric - * value, is null or undefined - * @return offsets - */ - computeOffsets:function (treeSet, node) { - $assert(treeSet, "treeSet can no be null."); - $assert(node, "node can no be null."); - - var children = this._getSortedChildren(treeSet, node); - - // Compute heights ... - var heights = children.map( - function (child) { - return {id:child.getId(), order:child.getOrder(), position:child.getPosition(), width:child.getSize().width, height:this._computeChildrenHeight(treeSet, child)}; - }, this).reverse(); - - // Compute the center of the branch ... - var totalHeight = 0; - _.each(heights, function (elem) { - totalHeight += elem.height; - }); - var ysum = totalHeight / 2; - - // Calculate the offsets ... - var result = {}; - for (var i = 0; i < heights.length; i++) { - ysum = ysum - heights[i].height; - var childNode = treeSet.find(heights[i].id); - var direction = this.getChildDirection(treeSet, childNode); - - var yOffset = ysum + heights[i].height / 2; - var xOffset = direction * (heights[i].width / 2 + node.getSize().width / 2 + mindplot.layout.SymmetricSorter.INTERNODE_HORIZONTAL_PADDING); - - $assert(!isNaN(xOffset), "xOffset can not be null"); - $assert(!isNaN(yOffset), "yOffset can not be null"); - - result[heights[i].id] = {x:xOffset, y:yOffset}; - } - return result; - }, - - /** - * @param treeSet - * @param node - * @throws will throw an error if order elements are missing - */ - verify:function (treeSet, node) { - // Check that all is consistent ... - var children = this._getSortedChildren(treeSet, node); - - for (var i = 0; i < children.length; i++) { - $assert(children[i].getOrder() == i, "missing order elements"); - } - }, - - /** - * @param treeSet - * @param child - * @return direction of the given child from its parent or from the root node, if isolated*/ - getChildDirection:function (treeSet, child) { - $assert(treeSet, "treeSet can no be null."); - $assert(treeSet.getParent(child), "This should not happen"); - - var result; - var rootNode = treeSet.getRootNode(child); - if (treeSet.getParent(child) == rootNode) { - // This is the case of a isolated child ... In this case, the directions is based on the root. - result = Math.sign(rootNode.getPosition().x); - } else { - // if this is not the case, honor the direction of the parent ... - var parent = treeSet.getParent(child); - var grandParent = treeSet.getParent(parent); - var sorter = grandParent.getSorter(); - result = sorter.getChildDirection(treeSet, parent); - - } - return result; - }, - - /** @return {String} the print name of this class */ - toString:function () { - return "Symmetric Sorter"; - }, - - _getVerticalPadding:function () { - return mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING; - } -}); - -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING = 5; -/** - * @constant - * @type {Number} - * @default - */ -mindplot.layout.SymmetricSorter.INTERNODE_HORIZONTAL_PADDING = 30; - - diff --git a/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js b/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js deleted file mode 100644 index 4f12b859..00000000 --- a/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.Request.js +++ /dev/null @@ -1,49 +0,0 @@ -BootstrapDialog.Request = new Class({ - - Extends: BootstrapDialog, - - initialize: function(url, title, options) { - this.parent(title, options); - this.requestOptions = {}; - this.requestOptions.cache = false; - var me = this; - this.requestOptions.fail = function(xhr) { - // Intercept form requests ... - console.log("Failure:"); - console.log(xhr); - }; - - this.requestOptions.success = function() { - // Intercept form requests ... - var forms = me._native.find('form'); - _.each(forms, function(form) { - $(form).on('submit', function(event) { - // Intercept form ... - me.requestOptions.url = form.action; - me.requestOptions.method = form.method ? form.method : 'post'; - $.ajax(me.requestOptions); - event.stopPropagation(); - return false; - }); - }); - }; - - this._native.find('.modal-body').load(url, function () { - me.acceptButton.unbind('click').click(function () { - submitDialogForm(); - }); - me._native.on('hidden.bs.modal', function () { - $(this).remove(); - }); - me.show(); - }); - }, - - onDialogShown: function() { - if (typeof(onDialogShown) == "function") { - onDialogShown(); - } - } - - -}); diff --git a/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js b/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js deleted file mode 100644 index 83f37aef..00000000 --- a/mindplot/src/main/javascript/libraries/bootstrap/BootstrapDialog.js +++ /dev/null @@ -1,111 +0,0 @@ -var BootstrapDialog = new Class({ - Implements: Options, - - options: { - cancelButton: false, - closeButton: false, - acceptButton: true, - removeButton:false, - errorMessage: false, - onEventData:{} - }, - - initialize: function (title, options) { - this.setOptions(options); - this.options.onEventData.dialog = this; - this._native = $('').append(''); - var content = $(''); - var header = this._buildHeader(title); - if (header) { - content.append(header); - } - var body = $(''); - if(this.options.errorMessage){ - var error = $('
'); - error.hide(); - body.append(error); - } - content.append(body); - var footer = this._buildFooter(); - if (footer) { - content.append(footer); - } - this._native.find(".modal-dialog").append(content); - this._native.on('hidden.bs.modal', function() { - $(this).remove(); - }); - this._native.on('shown.bs.modal', this.onDialogShown); - }, - - _buildFooter: function() { - var footer = null; - if (this.options.acceptButton || this.options.removeButton || this.options.cancelButton) { - footer = $('