Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2021a39229 | ||
|
|
7fdf08a6b1 | ||
|
|
8e40ce9a18 | ||
|
|
600bde0e15 | ||
|
|
905e1b8ee5 | ||
|
|
b8cfed1a25 | ||
|
|
9c56f9e40a | ||
|
|
a0c9abf9b1 | ||
|
|
af5d804197 | ||
|
|
356425d71c | ||
|
|
8578914dc1 | ||
|
|
4134cceb2a | ||
|
|
49dbb1898b | ||
|
|
98c1c9428d | ||
|
|
df0a9a4496 | ||
|
|
9a41f3b288 | ||
|
|
0b742f2577 | ||
|
|
c4858265b1 | ||
|
|
03ef9d9770 | ||
|
|
54839b0d53 | ||
|
|
314df3ca68 | ||
|
|
82a9dc8f24 | ||
|
|
cfe833f947 | ||
|
|
2b81b71cb4 | ||
|
|
cbdc1679db | ||
|
|
f5aee9d78f | ||
|
|
a4ab2a2e42 | ||
|
|
4b8d6a51f3 | ||
|
|
a6c066273b | ||
|
|
2430db31b3 | ||
|
|
4fc6216b97 | ||
|
|
47793ec4e2 | ||
|
|
89b2a871e2 | ||
|
|
8ddb66eebb | ||
|
|
4777ccf6fb | ||
|
|
8db75a940d | ||
|
|
be4cebf64b | ||
|
|
67d2954f9e | ||
|
|
c1989c4562 | ||
|
|
6b3f50914f | ||
|
|
bfa403a14f | ||
|
|
fa58c683c0 | ||
|
|
85804b74a4 | ||
|
|
96e66bf826 | ||
|
|
ae64037f3a | ||
|
|
67c4968aca | ||
|
|
c55f199b67 | ||
|
|
1fc7ebedee | ||
|
|
62d94ba6aa | ||
|
|
fa6b564641 | ||
|
|
d9ac411733 | ||
|
|
afc4857891 | ||
|
|
34b2940ab0 | ||
|
|
ad80e7c04c | ||
|
|
cce94a594e | ||
|
|
38dda86b84 | ||
|
|
ce9f99365e | ||
|
|
9ed086eeb9 | ||
|
|
61e16d5979 | ||
|
|
a1e208de20 | ||
|
|
bba58d79f0 | ||
|
|
d33a16b7f3 | ||
|
|
3e632939c2 | ||
|
|
08784308a0 | ||
|
|
c2ecba8e08 | ||
|
|
2d1a2c4a3f | ||
|
|
c0863a7372 | ||
|
|
aecd8651eb | ||
|
|
baea74ad13 | ||
|
|
2ef39c79ae | ||
|
|
65f9bd5ae6 |
@@ -1,19 +1,13 @@
|
||||
# WiseMapping: a Web based mindmapping application
|
||||
# Compiling and Running
|
||||
|
||||
## Project Information
|
||||
|
||||
The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com.
|
||||
|
||||
## Compiling and Running
|
||||
|
||||
### Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 2.2.1 or higher (http://maven.apache.org/)
|
||||
|
||||
### Compiling
|
||||
## Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
|
||||
@@ -28,7 +22,7 @@ Full compilation of the project can be done executing within <project-dir>:
|
||||
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping.war will be generated.
|
||||
|
||||
### Testing
|
||||
## Testing
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
@@ -36,16 +30,5 @@ The previously generated war can be deployed locally executing within the direct
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
Password: test
|
||||
|
||||
## Author
|
||||
|
||||
Pablo Luna
|
||||
Paulo Veiga
|
||||
Ignacio Manzano
|
||||
Nicolas Damonte
|
||||
|
||||
## License
|
||||
|
||||
The source code is Licensed under the Apache License, Version 2.0 (the “License”);
|
||||
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
|
||||
Password: test
|
||||
53
Documentation.textile
Normal file
53
Documentation.textile
Normal file
@@ -0,0 +1,53 @@
|
||||
h1. Documentation
|
||||
|
||||
h2. Architecture
|
||||
|
||||
WiseMapping has been development mainly in Java and JavaScript. The following diagram represents a high level overview of the product
|
||||
[[http://www.wisemapping.org/_/rsrc/1257718018304/documentation/architecture/Wise%20Editor%20Architecture.png]]
|
||||
|
||||
h2. Configuration
|
||||
|
||||
h3. DataBase
|
||||
|
||||
Wisemapping support a wide variety of databases, but we provide the Database’s script initialization for HSQL and MySQL Database. The initialization script are located within <WISEMAPPING_SOURCE_DIR>\trunk\wise-webapp\src\test\sql.
|
||||
|
||||
This directory contains the following 3 scripts::
|
||||
create-schemas.sql: Contains all the SQL statement to create the Wisemapping’s tables.
|
||||
drop-schemas.sql:Contains all the SQL statement to drop all the Wisemapping database.
|
||||
test-data.sql: This script creates a sample data and the test user called test@wisemapping.com and password test.
|
||||
MySQL
|
||||
|
||||
h4. Create Database User
|
||||
|
||||
Using the MySQL Databse Tools run the following command in order to create the database user.
|
||||
|
||||
CREATE DATABASE wisemapping CHARACTER SET='utf8' COLLATE='utf8_unicode_ci';
|
||||
CREATE USER 'wisemapping'@'localhost' IDENTIFIED BY 'd0ndu3nd3';
|
||||
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';
|
||||
|
||||
h3. Configuration
|
||||
|
||||
You can configure Wisemapping through the following file:
|
||||
|
||||
wise-webapp\src\main\webapp\WEB-INF\app.properties.
|
||||
|
||||
This property file contains all the properties to configure the database, mail and other resources used by Wisemapping.
|
||||
|
||||
Property -> Description
|
||||
* database.url -> The Database URL(Ex. dbc:hsqldb:file:target/db/wisemapping)
|
||||
* database.driver-> The Database Driver.(Ex. org.hsqldb.jdbcDriver)
|
||||
* database.hibernate.dialect -> The Database dialect. This value is used by Spring DB.(Ex. org.hibernate.dialect.HSQLDialect)
|
||||
* database.username -> The database username
|
||||
* database.password -> The database password
|
||||
* mail.smtp.socketFactory.port -> The mail port to send email
|
||||
* mail.host -> The email server host
|
||||
* mail.user -> The mail username
|
||||
* mail.password -> The mail password
|
||||
* mail.registrationEmail -> The email used as FROM in the registration emails.
|
||||
* mail.siteEmail -> The email used as FROM in the notification emails.
|
||||
|
||||
h3. Logging Properties
|
||||
|
||||
WiseMapping uses Log4J to log all the events. The configuration file is located in :
|
||||
|
||||
<WISEMAPPING_DIR>\wise-webapp\src\main\webapp\WEB-INF\classes
|
||||
11
Faq.textile
Normal file
11
Faq.textile
Normal file
@@ -0,0 +1,11 @@
|
||||
h1. FAQ
|
||||
|
||||
h2. Which technology is being used to render the mind maps?
|
||||
|
||||
We use SVG for Firefox and Safari, and VML for IE and Opera.
|
||||
|
||||
SVG (Scalable Vectorial Graphics) allows straightforward and efficient vector graphics animation and VML (Vector Markup Language) supports the markup of vector graphic information in the same way that HTML supports the markup of textual information.
|
||||
|
||||
h2. What's the source code License?
|
||||
|
||||
http://www.wisemapping.org/license
|
||||
21
Home.textile
Normal file
21
Home.textile
Normal file
@@ -0,0 +1,21 @@
|
||||
h1. What is WiseMapping Open Source?
|
||||
|
||||
WiseMapping is a free web based mindmapping application. The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com.
|
||||
|
||||
h1. Why Open Source ?
|
||||
|
||||
In the last years, we have received hundred of mails from different persons asking for:
|
||||
Integrating wisemapping.com with their sites
|
||||
Deploying a private instance of wisemapping.com
|
||||
Participating in the development of the site
|
||||
All this make us wonder "Why if we share our product to all this people and invite them to participate with us in this journey ?" .
|
||||
|
||||
h1. Who are we ?
|
||||
|
||||
We’re a couple of friends working on an idea: “Create the best on-line collaborative mind mapping tool ever created”. This has been our idea since the first day we started.
|
||||
|
||||
h1. [[Documentation]]
|
||||
|
||||
h1. [[Compiling and Running]]
|
||||
|
||||
h1. [[FAQ]]
|
||||
11
README.md
11
README.md
@@ -2,21 +2,19 @@
|
||||
|
||||
## Project Information
|
||||
|
||||
The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com.
|
||||
The goal of this project is to provide a high quality product that can be deployed by educational and academic institutions, private and public companies and anyone who needs to have a mindmapping application. WiseMapping is based on the same code source supporting WiseMapping.com. More info: www.wisemapping.org
|
||||
|
||||
## Compiling and Running
|
||||
|
||||
### Prerequisites
|
||||
|
||||
The following products must be installed:
|
||||
|
||||
* Java Development Kit 6 or higher (http://java.sun.com/javase/downloads/index.jsp)
|
||||
* Maven 2.2.1 or higher (http://maven.apache.org/)
|
||||
|
||||
### Compiling
|
||||
|
||||
WiseMapping uses Maven as packaging and project management. The project is composed of 4 maven sub-modules:
|
||||
|
||||
* core-js: Utilities JavaScript libraries
|
||||
* web2d: JavaScript 2D VML/SVG abstraction library used by the mind map editor
|
||||
* mindplot: JavaScript mind map designer core
|
||||
@@ -29,6 +27,7 @@ Full compilation of the project can be done executing within <project-dir>:
|
||||
Once this command is execute, the file <project-dir>/wise-webapp/target/wisemapping.war will be generated.
|
||||
|
||||
### Testing
|
||||
|
||||
The previously generated war can be deployed locally executing within the directory <project-dir>/wise-webapp the following command:
|
||||
|
||||
`mvn jetty:run-war`
|
||||
@@ -36,7 +35,6 @@ The previously generated war can be deployed locally executing within the direct
|
||||
This will start the application on the URL: http://localhost:8080/wise-webapp/. Additionally, a file based database is automatically populated with a test user.
|
||||
|
||||
User: test@wisemapping.org
|
||||
Password: test
|
||||
|
||||
## Author
|
||||
|
||||
@@ -47,5 +45,6 @@ Password: test
|
||||
|
||||
## License
|
||||
|
||||
The source code is Licensed under the Apache License, Version 2.0 (the “License”);
|
||||
You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
|
||||
The source code is Licensed under the WiseMapping Open License, Version 1.0 (the “License”);
|
||||
|
||||
You may obtain a copy of the License at: http://www.wisemapping.org/license
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
core.ColorPicker = function()
|
||||
{
|
||||
this.palette = "7x10";
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
core.Loader =
|
||||
{
|
||||
load: function(scriptPath, stylePath,jsFileName)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
core.Monitor = function(fadeElement, logContentElem)
|
||||
{
|
||||
core.assert(fadeElement, "fadeElement can not be null");
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
core.Point = function(x, y)
|
||||
{
|
||||
this.x = x;
|
||||
@@ -37,4 +36,9 @@ core.Point.prototype.inspect = function()
|
||||
core.Point.prototype.clone = function()
|
||||
{
|
||||
return new core.Point(this.x, this.y);
|
||||
};
|
||||
};
|
||||
|
||||
core.Point.fromString = function(point) {
|
||||
var values = point.split(',');
|
||||
return new core.Point(values[0], values[1]);
|
||||
};
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.UserAgent = {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
core.Utils =
|
||||
@@ -64,7 +63,8 @@ core.assert = function(assert, message)
|
||||
{
|
||||
stack = e;
|
||||
}
|
||||
core.Logger.logError(message + "," + stack);
|
||||
wLogger.error(message + "," + stack);
|
||||
// core.Logger.logError(message + "," + stack);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -220,3 +220,115 @@ core.Utils.createDocumentFromText = function(/*string*/str, /*string?*/mimetype)
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
core.Utils.calculateRelationShipPointCoordinates = function(topic,controlPoint){
|
||||
var size = topic.getSize();
|
||||
var position = topic.getPosition();
|
||||
var m = (position.y-controlPoint.y)/(position.x-controlPoint.x);
|
||||
var y,x;
|
||||
var gap = 5;
|
||||
if(controlPoint.y>position.y+(size.height/2)){
|
||||
y = position.y+(size.height/2)+gap;
|
||||
x = position.x-((position.y-y)/m);
|
||||
if(x>position.x+(size.width/2)){
|
||||
x=position.x+(size.width/2);
|
||||
}else if(x<position.x-(size.width/2)){
|
||||
x=position.x-(size.width/2);
|
||||
}
|
||||
}else if(controlPoint.y<position.y-(size.height/2)){
|
||||
y = position.y-(size.height/2) - gap;
|
||||
x = position.x-((position.y-y)/m);
|
||||
if(x>position.x+(size.width/2)){
|
||||
x=position.x+(size.width/2);
|
||||
}else if(x<position.x-(size.width/2)){
|
||||
x=position.x-(size.width/2);
|
||||
}
|
||||
}else if(controlPoint.x<(position.x-size.width/2)){
|
||||
x = position.x-(size.width/2) -gap;
|
||||
y = position.y-(m*(position.x-x));
|
||||
}else{
|
||||
x = position.x+(size.width/2) + gap;
|
||||
y = position.y-(m*(position.x-x));
|
||||
}
|
||||
|
||||
return new core.Point(x,y);
|
||||
};
|
||||
|
||||
core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos){
|
||||
var y = srcPos.y-tarPos.y;
|
||||
var x = srcPos.x-tarPos.x;
|
||||
var m = y/x;
|
||||
var l = Math.sqrt(y*y+x*x)/3;
|
||||
var fix=1;
|
||||
if(srcPos.x>tarPos.x){
|
||||
fix=-1;
|
||||
}
|
||||
|
||||
var x1 = srcPos.x + Math.sqrt(l*l/(1+(m*m)))*fix;
|
||||
var y1 = m*(x1-srcPos.x)+srcPos.y;
|
||||
var x2 = tarPos.x + Math.sqrt(l*l/(1+(m*m)))*fix*-1;
|
||||
var y2= m*(x2-tarPos.x)+tarPos.y;
|
||||
|
||||
return [new core.Point(-srcPos.x + x1,-srcPos.y + y1),new core.Point(-tarPos.x + x2,-tarPos.y + y2)];
|
||||
};
|
||||
|
||||
core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn){
|
||||
core.Utils.animateVisibility(elems, isVisible, doneFn);
|
||||
};
|
||||
core.Utils.setChildrenVisibilityAnimated = function(rootElem, isVisible){
|
||||
var children = core.Utils._addInnerChildrens(rootElem);
|
||||
core.Utils.animateVisibility(children, isVisible);
|
||||
};
|
||||
|
||||
core.Utils.animateVisibility = function (elems, isVisible, doneFn){
|
||||
var _fadeEffect=null;
|
||||
var _opacity = (isVisible?0:1);
|
||||
if(isVisible){
|
||||
elems.forEach(function(child, index){
|
||||
child.setOpacity(_opacity);
|
||||
child.setVisibility(isVisible);
|
||||
});
|
||||
}
|
||||
var fadeEffect = function(index)
|
||||
{
|
||||
var step = 10;
|
||||
if((_opacity<=0 && !isVisible) || (_opacity>=1 && isVisible)){
|
||||
$clear(_fadeEffect);
|
||||
_fadeEffect = null;
|
||||
elems.forEach(function(child, index){
|
||||
|
||||
child.setVisibility(isVisible);
|
||||
|
||||
});
|
||||
if(core.Utils.isDefined(doneFn))
|
||||
doneFn.attempt();
|
||||
}
|
||||
else{
|
||||
var fix = 1;
|
||||
if(isVisible){
|
||||
fix = -1;
|
||||
}
|
||||
_opacity-=(1/step)*fix;
|
||||
elems.forEach(function(child, index){
|
||||
child.setOpacity(_opacity);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
_fadeEffect =fadeEffect.periodical(30);
|
||||
};
|
||||
|
||||
core.Utils._addInnerChildrens = function(elem){
|
||||
var children = [];
|
||||
var childs = elem._getChildren();
|
||||
for(var i = 0 ; i<childs.length; i++){
|
||||
var child = childs[i];
|
||||
children.push(child);
|
||||
children.push(child.getOutgoingLine());
|
||||
var relationships = child.getRelationships();
|
||||
children = children.concat(relationships);
|
||||
var innerChilds = core.Utils._addInnerChildrens(child);
|
||||
children = children.concat(innerChilds);
|
||||
}
|
||||
return children;
|
||||
};
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// Init default logger level ...
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = {};
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*jsl:option explicit*/
|
||||
|
||||
@@ -1,30 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
#set -x
|
||||
WISE_VERSION=0.94
|
||||
set -e
|
||||
|
||||
WISE_VERSION=0.96
|
||||
BASE_DIR=`pwd`
|
||||
TARGET_DIR=$BASE_DIR/target
|
||||
JETTY_DIR=$TARGET_DIR/wisemapping-$WISE_VERSION
|
||||
WISE_WEBAPP_DIR=$JETTY_DIR/webapps/wisemapping
|
||||
JETTY_DIST_DIR=jetty-distribution-7.3.0.v20110203
|
||||
JETTY_ZIP=${JETTY_DIST_DIR}.zip
|
||||
|
||||
# Clean ...
|
||||
mvn -f $BASE_DIR/../pom.xml clean
|
||||
mkdir target 2>/dev/null
|
||||
rm -fr $JETTY_DIR
|
||||
rm -fr $TARGET_DIR/jetty-hightide-7.0.0.v20091005
|
||||
[ ! -e target ] && mkdir target
|
||||
rm -fr ${JETTY_DIR}
|
||||
rm -fr ${TARGET_DIR}/jetty-distribution-7.3.0.v20110203
|
||||
|
||||
# Prepare resources ..
|
||||
mvn -f $BASE_DIR/../pom.xml install
|
||||
|
||||
if [ ! -f ./target/jetty-hightide-7.0.0.v20091005.zip ]
|
||||
if [ ! -f ./target/${JETTY_ZIP} ]
|
||||
then
|
||||
echo "Download Jetty"
|
||||
wget http://dist.codehaus.org/jetty/jetty-7.0.0/jetty-hightide-7.0.0.v20091005.zip -P $TARGET_DIR
|
||||
wget http://download.eclipse.org/jetty/stable-7/dist/${JETTY_ZIP} -P $TARGET_DIR
|
||||
fi
|
||||
|
||||
echo "Unzip Jetty ...:"
|
||||
unzip $TARGET_DIR/jetty-hightide-7.0.0.v20091005.zip -d $TARGET_DIR/ > /dev/null
|
||||
mv $TARGET_DIR/jetty-hightide-7.0.0.v20091005 $JETTY_DIR
|
||||
unzip ${TARGET_DIR}/${JETTY_ZIP} -d ${TARGET_DIR}/ > /dev/null
|
||||
mv ${TARGET_DIR}/${JETTY_DIST_DIR} ${JETTY_DIR}
|
||||
|
||||
|
||||
# Clean unsed files ...
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="header.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Mindmap.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="NodeModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="MindmapDesigner.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ScreenManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Workspace.js"/>
|
||||
@@ -55,6 +56,7 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="CentralTopicBoard.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="MainTopicBoard.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ConnectionLine.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipLine.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DragTopicPositioner.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Board.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="TextEditor.js"/>
|
||||
@@ -62,7 +64,11 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="util/Shape.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="FixedDistanceBoard.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="BoardEntry.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="XMLMindmapSerializer.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ModelCodeName.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="XMLMindmapSerializer_Pela.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="XMLMindmapSerializer_Beta.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Beta2PelaMigrator.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="XMLMindmapSerializerFactory.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="PersistanceManager.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="EditorProperties.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="IconGroup.js"/>
|
||||
@@ -75,11 +81,10 @@
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="IconModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="LinkModel.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="NoteModel.js"/>
|
||||
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="Command.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DesignerActionRunner.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="DesignerUndoManager.js"/>
|
||||
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="ControlPoint.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="commands/GenericFunctionCommand.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
@@ -100,7 +105,10 @@
|
||||
files="commands/AddNoteToTopicCommand.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="commands/RemoveNoteFromTopicCommand.js"/>
|
||||
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="commands/AddRelationshipCommand.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/"
|
||||
files="commands/MoveControlPointCommand.js"/>
|
||||
<filelist dir="${basedir}/src/main/javascript/" files="footer.js"/>
|
||||
</concat>
|
||||
|
||||
@@ -144,6 +152,7 @@
|
||||
<include>header-min.js</include>
|
||||
<include>Mindmap-min.js</include>
|
||||
<include>NodeModel-min.js</include>
|
||||
<include>RelationshipModel-min.js</include>
|
||||
<include>MindmapDesigner-min.js</include>
|
||||
<include>ScreenManager-min.js</include>
|
||||
<include>Workspace-min.js</include>
|
||||
@@ -159,6 +168,7 @@
|
||||
<include>CentralTopicBoard-min.js</include>
|
||||
<include>MainTopicBoard-min.js</include>
|
||||
<include>ConnectionLine-min.js</include>
|
||||
<include>RelationshipLine-min.js</include>
|
||||
<include>DragTopicPositioner-min.js</include>
|
||||
<include>Board-min.js</include>
|
||||
<include>TextEditor-min.js</include>
|
||||
@@ -166,7 +176,11 @@
|
||||
<include>util/Shape-min.js</include>
|
||||
<include>FixedDistanceBoard-min.js</include>
|
||||
<include>BoardEntry-min.js</include>
|
||||
<include>XMLMindmapSerializer-min.js</include>
|
||||
<include>ModelCodeName-min.js</include>
|
||||
<include>XMLMindmapSerializer_Beta-min.js</include>
|
||||
<include>XMLMindmapSerializer_Pela-min.js</include>
|
||||
<include>Beta2PelaMigrator-min.js</include>
|
||||
<include>XMLMindmapSerializerFactory-min.js</include>
|
||||
<include>PersistanceManager-min.js</include>
|
||||
<include>EditorProperties-min.js</include>
|
||||
<include>IconGroup-min.js</include>
|
||||
@@ -194,6 +208,8 @@
|
||||
<include>commands/RemoveIconFromTopicCommand-min.js</include>
|
||||
<include>commands/AddNoteToTopicCommand-min.js</include>
|
||||
<include>commands/RemoveNoteFromTopicCommand-min.js</include>
|
||||
<include>commands/AddRelationshipCommand-min.js</include>
|
||||
<include>commands/MoveControlPointCommand-min.js</include>
|
||||
|
||||
<include>footer-min.js</include>
|
||||
|
||||
|
||||
34
mindplot/src/main/javascript/Beta2PelaMigrator.js
Normal file
34
mindplot/src/main/javascript/Beta2PelaMigrator.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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.Beta2PelaMigrator = function(betaSerializer){
|
||||
this._betaSerializer=betaSerializer;
|
||||
this._pelaSerializer = new mindplot.XMLMindmapSerializer_Pela();
|
||||
};
|
||||
|
||||
mindplot.Beta2PelaMigrator.prototype.toXML = function(mindmap)
|
||||
{
|
||||
return this._pelaSerializer.toXML(mindmap);
|
||||
};
|
||||
|
||||
|
||||
mindplot.Beta2PelaMigrator.prototype.loadFromDom = function(dom)
|
||||
{
|
||||
var mindmap = this._betaSerializer.loadFromDom(dom);
|
||||
mindmap.setVersion(mindplot.ModelCodeName.PELA);
|
||||
return mindmap;
|
||||
};
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.Board = function(defaultHeight, referencePoint)
|
||||
{
|
||||
this.initialize(defaultHeight, referencePoint);
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.BoardEntry = function(lowerLimit, upperLimit, order)
|
||||
{
|
||||
if (lowerLimit && upperLimit)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.BubbleTip = function(divContainer){
|
||||
@@ -45,7 +44,7 @@ mindplot.BubbleTip.prototype.scanElements=function(form){
|
||||
}
|
||||
}, this);
|
||||
};
|
||||
mindplot.BubbleTip.prototype.buildBubble=function(invert){
|
||||
mindplot.BubbleTip.prototype.buildBubble=function(){
|
||||
var opts = this.options;
|
||||
|
||||
var panel = new Element('div').addClass('bubbleContainer');
|
||||
@@ -54,53 +53,8 @@ mindplot.BubbleTip.prototype.buildBubble=function(invert){
|
||||
if($chk(opts.width))
|
||||
panel.setStyle('width', opts.width);
|
||||
|
||||
var topClass="";
|
||||
var bottomClass="Hint";
|
||||
if($chk(invert)){
|
||||
var tmpClass = topClass;
|
||||
topClass=bottomClass;
|
||||
bottomClass=tmpClass;
|
||||
}
|
||||
|
||||
//build top part of bubble
|
||||
this.topContainer = new Element('div').addClass('bublePartContainer');
|
||||
this.topLeft = new Element('div').addClass('bubblePart').addClass('bubble'+topClass+'TopLeftBlue');
|
||||
this.top = new Element('div').addClass('bubblePart').addClass('bubble'+topClass+'TopBlue');
|
||||
this.topHint =new Element('div').addClass('bubblePart').addClass('bubbleTop'+topClass+'Blue').setStyle('width',58);
|
||||
this.top2 = new Element('div').addClass('bubblePart').addClass('bubble'+topClass+'TopBlue');
|
||||
this.topRight = new Element('div').addClass('bubblePart').addClass('bubble'+topClass+'TopRightBlue');
|
||||
this.topLeft.inject(this.topContainer);
|
||||
this.top.inject(this.topContainer);
|
||||
this.topHint.inject(this.topContainer);
|
||||
this.top2.inject(this.topContainer);
|
||||
this.topRight.inject(this.topContainer);
|
||||
|
||||
//build middle part of bubble
|
||||
this.middleContainer = new Element('div').addClass('bublePartContainer');
|
||||
this.left = new Element('div').addClass('bubblePart').addClass('bubbleLeftBlue');
|
||||
this.center = new Element('div').addClass('bubblePart').addClass('bubbleCenterBlue');
|
||||
this.right = new Element('div').addClass('bubblePart').addClass('bubbleRightBlue');
|
||||
this.left.inject(this.middleContainer);
|
||||
this.center.inject(this.middleContainer);
|
||||
this.right.inject(this.middleContainer);
|
||||
|
||||
//build bottom part of bubble
|
||||
this.bottomContainer = new Element('div').addClass('bublePartContainer');
|
||||
this.bottomLeft = new Element('div').addClass('bubblePart').addClass('bubble'+bottomClass+'BottomLeftBlue');
|
||||
this.bottom = new Element('div').addClass('bubblePart').addClass('bubble'+bottomClass+'BottomBlue');
|
||||
this.bottomHint =new Element('div').addClass('bubblePart').addClass('bubbleBottom'+bottomClass+'Blue').setStyle('width',58);
|
||||
this.bottom2 = new Element('div').addClass('bubblePart').addClass('bubble'+bottomClass+'BottomBlue');
|
||||
this.bottomRight = new Element('div').addClass('bubblePart').addClass('bubble'+bottomClass+'BottomRightBlue');
|
||||
this.bottomLeft.inject(this.bottomContainer);
|
||||
this.bottom.inject(this.bottomContainer);
|
||||
this.bottomHint.inject(this.bottomContainer);
|
||||
this.bottom2.inject(this.bottomContainer);
|
||||
this.bottomRight.inject(this.bottomContainer);
|
||||
|
||||
this.topContainer.inject(panel);
|
||||
this.middleContainer.inject(panel);
|
||||
this.bottomContainer.inject(panel);
|
||||
|
||||
this.center.inject(panel);
|
||||
if(!$chk(opts.divContainer))
|
||||
{
|
||||
opts.divContainer=document.body;
|
||||
@@ -154,12 +108,6 @@ mindplot.BubbleTip.prototype.forceClose=function(){
|
||||
this.options.panel.effect('opacity',{duration:100, onComplete:function(){
|
||||
this._open=false;
|
||||
$(this.options.panel).setStyles({left:0,top:0});
|
||||
$(this.top2).setStyle('width', 3);
|
||||
$(this.bottom2).setStyle('width', 3);
|
||||
$(this.top).setStyle('width', 3);
|
||||
$(this.bottom).setStyle('width', 3);
|
||||
$(this.left).setStyle('height', 4);
|
||||
$(this.right).setStyle('height', 4);
|
||||
$(this.options.container).remove();
|
||||
}.bind(this)}).start(100,0);
|
||||
};
|
||||
@@ -167,6 +115,7 @@ mindplot.BubbleTip.prototype.init=function(event,source){
|
||||
var opts = this.options;
|
||||
var coordinates = $(opts.panel).getCoordinates();
|
||||
var panelHeight = coordinates.height; //not total height, but close enough
|
||||
var panelWidth = coordinates.width; //not total height, but close enough
|
||||
|
||||
var offset = designer.getWorkSpace().getScreenManager().getWorkspaceIconPosition(source);
|
||||
|
||||
@@ -174,65 +123,26 @@ mindplot.BubbleTip.prototype.init=function(event,source){
|
||||
var screenWidth = containerCoords.width;
|
||||
var screenHeight = containerCoords.height;
|
||||
|
||||
var invert = false;
|
||||
var picoFix=20;
|
||||
var width = $(this.center).getCoordinates().width;
|
||||
|
||||
var centerWidth = $(this.center).getCoordinates().width;
|
||||
|
||||
if(offset.y > panelHeight){ //hint goes on the bottom
|
||||
if(!$(this.topLeft).hasClass('bubbleTopLeftBlue')){
|
||||
$(this.options.panel).remove();
|
||||
this.buildBubble(false);
|
||||
$(this.options.container).inject(this.center);
|
||||
}
|
||||
}
|
||||
else{
|
||||
invert=true;
|
||||
picoFix=0;
|
||||
if($(this.topLeft).hasClass('bubbleTopLeftBlue')){
|
||||
$(this.options.panel).remove();
|
||||
this.buildBubble(invert);
|
||||
$(this.options.container).inject(this.center);
|
||||
}
|
||||
centerWidth = centerWidth-1;
|
||||
}
|
||||
|
||||
offset.y = offset.y + picoFix;
|
||||
var width = centerWidth - $(this.topHint).getCoordinates().width;
|
||||
|
||||
if((screenWidth -offset.x)>coordinates.width){
|
||||
width= width-$(this.top).getCoordinates().width;
|
||||
$(this.top2).setStyle('width', width);
|
||||
$(this.bottom2).setStyle('width', width);
|
||||
}
|
||||
else{
|
||||
width= width-$(this.top2).getCoordinates().width;
|
||||
$(this.top).setStyle('width', width);
|
||||
$(this.bottom).setStyle('width', width);
|
||||
}
|
||||
|
||||
width = centerWidth + $(this.topLeft).getCoordinates().width;
|
||||
//width = width + $(this.top).getCoordinates().width;
|
||||
//width = width + $(this.topHint).getCoordinates().width;
|
||||
width = width + $(this.topRight).getCoordinates().width;
|
||||
var invert = !(offset.y > panelHeight); //hint goes on the bottom
|
||||
var invertX = (screenWidth-offset.x > panelWidth); // hint goes on the right
|
||||
$(this.options.panel).remove();
|
||||
this.buildBubble();
|
||||
$(this.options.container).inject(this.center);
|
||||
|
||||
var height = $(this.center).getCoordinates().height;
|
||||
$(this.left).setStyle('height', height);
|
||||
$(this.right).setStyle('height', height);
|
||||
|
||||
height = height+ $(this.topLeft).getCoordinates().height;
|
||||
height = height+ $(this.bottomLeft).getCoordinates().height;
|
||||
$(opts.panel).setStyles({width:width,height:height});
|
||||
|
||||
this.moveTopic(offset, $(opts.panel).getCoordinates().height, invert);
|
||||
this.moveTopic(offset, $(opts.panel).getCoordinates().height, $(opts.panel).getCoordinates().width, invert, invertX);
|
||||
};
|
||||
mindplot.BubbleTip.prototype.moveTopic=function(offset, panelHeight, invert){
|
||||
var f = 1;
|
||||
mindplot.BubbleTip.prototype.moveTopic=function(offset, panelHeight, panelWidth, invert, invertX){
|
||||
var f = 1, fX=1;
|
||||
if($chk(invert))
|
||||
f=0;
|
||||
if($chk(invertX))
|
||||
fX=0;
|
||||
var opts = this.options;
|
||||
var width = $(this.bottomLeft).getCoordinates().width+$(this.bottom).getCoordinates().width-(2*(f-1));
|
||||
$(opts.panel).setStyles({left:offset.x - width, top:offset.y - (panelHeight*f)});
|
||||
$(opts.panel).setStyles({left:offset.x - (panelWidth*fX), top:offset.y - (panelHeight*f)});
|
||||
};
|
||||
|
||||
mindplot.BubbleTip.getInstance = function(divContainer)
|
||||
@@ -245,20 +155,3 @@ mindplot.BubbleTip.getInstance = function(divContainer)
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
buildAnchorContent:function(el, title){
|
||||
var imgContainer= new Element('div');
|
||||
var img = new Element('img');
|
||||
img.src='http://open.thumbshots.org/image.pxf?url='+el.href;
|
||||
img.inject(imgContainer);
|
||||
|
||||
var attribution = new Element('div');
|
||||
attribution.innerHTML="<a href='http://www.thumbshots.org' target='_blank' title='About Thumbshots thumbnails'>About Thumbshots thumbnails</a>";
|
||||
|
||||
var element = new Element('div');
|
||||
imgContainer.inject(element);
|
||||
attribution.inject(element);
|
||||
return element;
|
||||
}*/
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.CentralTopic = function(model)
|
||||
{
|
||||
core.assert(model, "Model can not be null");
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.CentralTopicBoard = function(centralTopic)
|
||||
{
|
||||
var point = new core.Point(0, 0);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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(
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
mindplot.ConnectionLine = function(sourceNode, targetNode)
|
||||
/*
|
||||
* 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.ConnectionLine = function(sourceNode, targetNode, lineType)
|
||||
{
|
||||
core.assert(targetNode, 'parentNode node can not be null');
|
||||
core.assert(sourceNode, 'childNode node can not be null');
|
||||
@@ -30,17 +29,60 @@ mindplot.ConnectionLine = function(sourceNode, targetNode)
|
||||
var line;
|
||||
if (targetNode.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
line = new web2d.Line();
|
||||
line = this._createLine(lineType,mindplot.ConnectionLine.SIMPLE_CURVED);
|
||||
// line = new web2d.Line();
|
||||
if(line.getType()=="CurvedLine"){
|
||||
var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode);
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setStroke(1, 'solid', strokeColor);
|
||||
} else
|
||||
{
|
||||
line = new web2d.PolyLine();
|
||||
line = this._createLine(lineType,mindplot.ConnectionLine.POLYLINE);
|
||||
// line = new web2d.PolyLine();
|
||||
line.setStroke(1, 'solid', strokeColor);
|
||||
}
|
||||
|
||||
this._line2d = line;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype._getCtrlPoints = function(sourceNode, targetNode){
|
||||
var srcPos = sourceNode.getPosition();
|
||||
var destPos = targetNode.getPosition();
|
||||
var deltaX = Math.abs(Math.abs(srcPos.x) - Math.abs(destPos.x))/3;
|
||||
var fix = 1;
|
||||
if(mindplot.util.Shape.isAtRight(srcPos, destPos)){
|
||||
fix=-1;
|
||||
}
|
||||
return [new core.Point(deltaX*fix, 0), new core.Point(deltaX*-fix, 0)];
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype._createLine = function(lineType, defaultStyle){
|
||||
if(!core.Utils.isDefined(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;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.getStrokeColor = function()
|
||||
{
|
||||
return '#495879';
|
||||
@@ -48,8 +90,16 @@ mindplot.ConnectionLine.getStrokeColor = function()
|
||||
|
||||
mindplot.ConnectionLine.prototype.setVisibility = function(value)
|
||||
{
|
||||
var line2d = this._line2d;
|
||||
line2d.setVisibility(value);
|
||||
this._line2d.setVisibility(value);
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.isVisible = function()
|
||||
{
|
||||
return this._line2d.isVisible();
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.setOpacity = function(opacity){
|
||||
this._line2d.setOpacity(opacity);
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.redraw = function()
|
||||
@@ -61,11 +111,12 @@ mindplot.ConnectionLine.prototype.redraw = function()
|
||||
var targetTopic = this._targetTopic;
|
||||
var targetPosition = targetTopic.getPosition();
|
||||
|
||||
var sPos = sourceTopic.workoutOutgoingConnectionPoint(targetPosition);
|
||||
line2d.setTo(sPos.x, sPos.y);
|
||||
var sPos,tPos;
|
||||
sPos = sourceTopic.workoutOutgoingConnectionPoint(targetPosition, false);
|
||||
tPos = targetTopic.workoutIncomingConnectionPoint(sourcePosition, false);
|
||||
|
||||
var tPos = targetTopic.workoutIncomingConnectionPoint(sourcePosition);
|
||||
line2d.setFrom(tPos.x, tPos.y);
|
||||
line2d.setTo(sPos.x, sPos.y);
|
||||
|
||||
line2d.moveToBack();
|
||||
|
||||
@@ -122,4 +173,38 @@ mindplot.ConnectionLine.prototype.removeFromWorkspace = function(workspace)
|
||||
mindplot.ConnectionLine.prototype.getTargetTopic = function()
|
||||
{
|
||||
return this._targetTopic;
|
||||
};
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getSourceTopic = function()
|
||||
{
|
||||
return this._sourceTopic;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getLineType = function(){
|
||||
return this._lineType;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getLine = function(){
|
||||
return this._line2d;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getModel = function(){
|
||||
return this._model;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.setModel = function(model){
|
||||
this._model = model;
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getType = function(){
|
||||
return "ConnectionLine";
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.prototype.getId = function(){
|
||||
return this._model.getId();
|
||||
};
|
||||
|
||||
mindplot.ConnectionLine.SIMPLE=0;
|
||||
mindplot.ConnectionLine.POLYLINE=1;
|
||||
mindplot.ConnectionLine.CURVED=2;
|
||||
mindplot.ConnectionLine.SIMPLE_CURVED=3;
|
||||
170
mindplot/src/main/javascript/ControlPoint.js
Normal file
170
mindplot/src/main/javascript/ControlPoint.js
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 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.ControlPoint = function()
|
||||
{
|
||||
this._controlPointsController= [new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false}),
|
||||
new web2d.Elipse({width:6, height:6, stroke:'1 solid #6589de',fillColor:'gray', visibility:false})];
|
||||
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;
|
||||
this._controlPointsController[0].addEventListener('mousedown',this._mouseDown.bindWithEvent(this, mindplot.ControlPoint.FROM));
|
||||
this._controlPointsController[0].addEventListener('click',this._mouseClick.bindWithEvent(this));
|
||||
this._controlPointsController[0].addEventListener('dblclick',this._mouseClick.bindWithEvent(this));
|
||||
this._controlPointsController[1].addEventListener('mousedown',this._mouseDown.bindWithEvent(this,mindplot.ControlPoint.TO));
|
||||
this._controlPointsController[1].addEventListener('click',this._mouseClick.bindWithEvent(this));
|
||||
this._controlPointsController[1].addEventListener('dblclick',this._mouseClick.bindWithEvent(this));
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.setSide= function(side) {
|
||||
this._side = side;
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.setLine= function(line) {
|
||||
if(core.Utils.isDefined(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();
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.redraw = function(){
|
||||
if(this._line)
|
||||
this._createControlPoint();
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._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);
|
||||
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._removeLine= function() {
|
||||
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._mouseDown = function(event, point) {
|
||||
if(!this._isBinded){
|
||||
this._isBinded=true;
|
||||
this._mouseMoveFunction = this._mouseMove.bindWithEvent(this,point);
|
||||
this._workspace.getScreenManager().addEventListener('mousemove',this._mouseMoveFunction);
|
||||
this._mouseUpFunction = this._mouseUp.bindWithEvent(this,point);
|
||||
this._workspace.getScreenManager().addEventListener('mouseup',this._mouseUpFunction);
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
return false;
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._mouseMove = function(event, point) {
|
||||
var screen = this._workspace.getScreenManager();
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
var topic = null;
|
||||
if(point==0){
|
||||
var cords = core.Utils.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{
|
||||
var cords = core.Utils.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);
|
||||
/*event.preventDefault();
|
||||
event.stop();
|
||||
return false;*/
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._mouseUp = function(event, point) {
|
||||
this._workspace.getScreenManager().removeEventListener('mousemove',this._mouseMoveFunction);
|
||||
this._workspace.getScreenManager().removeEventListener('mouseup',this._mouseUpFunction);
|
||||
var command = new mindplot.commands.MoveControlPointCommand(this,point);
|
||||
designer._actionRunner.execute(command); //todo:Uggly!! designer is global!!
|
||||
this._isBinded=false;
|
||||
/*event.preventDefault();
|
||||
event.stop();
|
||||
return false;*/
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype._mouseClick = function(event){
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
return false;
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.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);
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.addToWorkspace = function(workspace){
|
||||
this._workspace = workspace;
|
||||
workspace.appendChild(this._controlPointsController[0]);
|
||||
workspace.appendChild(this._controlPointsController[1]);
|
||||
workspace.appendChild(this._controlLines[0]);
|
||||
workspace.appendChild(this._controlLines[1]);
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.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]);
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.getControlPoint = function(index){
|
||||
return this._controls[index];
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.getOriginalEndPoint = function(index){
|
||||
return this._endPoint[index];
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.prototype.getOriginalCtrlPoint = function(index){
|
||||
return this._orignalCtrlPoint[index];
|
||||
};
|
||||
|
||||
mindplot.ControlPoint.FROM = 0;
|
||||
mindplot.ControlPoint.TO = 1;
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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({
|
||||
@@ -93,14 +92,14 @@ mindplot.CommandContext = new Class({
|
||||
{
|
||||
this._designer._removeNode(topic);
|
||||
},
|
||||
createTopic:function(model)
|
||||
createTopic:function(model, isVisible)
|
||||
{
|
||||
core.assert(model, "model can not be null");
|
||||
var topic = this._designer._nodeModelToNodeGraph(model);
|
||||
var topic = this._designer._nodeModelToNodeGraph(model, isVisible);
|
||||
|
||||
// @todo: Is this required ?
|
||||
var designer = this._designer;
|
||||
designer.onNodeFocusEvent.attempt(topic, designer);
|
||||
designer.onObjectFocusEvent.attempt(topic, designer);
|
||||
|
||||
return topic;
|
||||
},
|
||||
@@ -110,13 +109,34 @@ mindplot.CommandContext = new Class({
|
||||
var model = mindmap.createNode(mindplot.NodeModel.MAIN_TOPIC_TYPE);
|
||||
return model;
|
||||
},
|
||||
connect:function(childTopic, parentTopic)
|
||||
connect:function(childTopic, parentTopic, isVisible)
|
||||
{
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace);
|
||||
childTopic.connectTo(parentTopic, this._designer._workspace, isVisible);
|
||||
} ,
|
||||
disconnect:function(topic)
|
||||
{
|
||||
topic.disconnect(this._designer._workspace);
|
||||
},
|
||||
createRelationship:function(model){
|
||||
core.assert(model, "model cannot be null");
|
||||
var relationship = this._designer.createRelationship(model);
|
||||
return relationship;
|
||||
},
|
||||
removeRelationship:function(model) {
|
||||
this._designer.removeRelationship(model);
|
||||
},
|
||||
findRelationships:function(lineIds){
|
||||
var result = [];
|
||||
lineIds.forEach(function(lineId, index){
|
||||
var line = this._designer._relationships[lineId];
|
||||
if(core.Utils.isDefined(line)){
|
||||
result.push(line);
|
||||
}
|
||||
}.bind(this));
|
||||
return result;
|
||||
},
|
||||
getSelectedRelationshipLines:function(){
|
||||
return this._designer.getSelectedRelationshipLines();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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({
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.DragManager = function(workspace)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.DragPivot = function()
|
||||
{
|
||||
this._position = new core.Point();
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.DragTopic = function(dragShape, draggedNode)
|
||||
{
|
||||
core.assert(core.Utils.isDefined(dragShape), 'Rect can not be null.');
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.DragTopicPositioner = function(workspace, topics)
|
||||
{
|
||||
core.assert(workspace, 'workspace can not be null');
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.EditorProperties = function()
|
||||
{
|
||||
this._zoom = 0;
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.FixedDistanceBoard = function(defaultHeight, topic)
|
||||
{
|
||||
this._topic = topic;
|
||||
@@ -74,7 +73,7 @@ mindplot.FixedDistanceBoard.prototype.updateReferencePoint = function()
|
||||
{
|
||||
var entries = this._entries;
|
||||
var parentTopic = this.getTopic();
|
||||
var parentPosition = parentTopic.workoutIncomingConnectionPoint(parentTopic);
|
||||
var parentPosition = parentTopic.workoutIncomingConnectionPoint(parentTopic.getPosition());
|
||||
var referencePoint = this.getReferencePoint();
|
||||
var yOffset = parentPosition.y - referencePoint.y;
|
||||
|
||||
@@ -82,15 +81,17 @@ mindplot.FixedDistanceBoard.prototype.updateReferencePoint = function()
|
||||
{
|
||||
var entry = entries[i];
|
||||
|
||||
var upperLimit = entry.getUpperLimit() + yOffset;
|
||||
var lowerLimit = entry.getLowerLimit() + yOffset;
|
||||
entry.setUpperLimit(upperLimit);
|
||||
entry.setLowerLimit(lowerLimit);
|
||||
if(core.Utils.isDefined(entry)){
|
||||
var upperLimit = entry.getUpperLimit() + yOffset;
|
||||
var lowerLimit = entry.getLowerLimit() + yOffset;
|
||||
entry.setUpperLimit(upperLimit);
|
||||
entry.setLowerLimit(lowerLimit);
|
||||
|
||||
// Fix x position ...
|
||||
var xPos = this.workoutXBorderDistance();
|
||||
entry.setXPosition(xPos);
|
||||
entry.update();
|
||||
// Fix x position ...
|
||||
var xPos = this.workoutXBorderDistance();
|
||||
entry.setXPosition(xPos);
|
||||
entry.update();
|
||||
}
|
||||
}
|
||||
this._referencePoint = parentPosition.clone();
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(url){
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(topic) {
|
||||
@@ -22,12 +21,13 @@ mindplot.IconGroup = function(topic) {
|
||||
this.options = {
|
||||
width:0,
|
||||
height:0,
|
||||
x:offset / 2,
|
||||
y:offset / 2,
|
||||
x:offset.x / 2,
|
||||
y:offset.y,
|
||||
icons:[],
|
||||
topic:topic,
|
||||
nativeElem:new web2d.Group({width: 2, height:2,x: offset / 2, y:offset / 2, coordSizeWidth:1,coordSizeHeight:1})
|
||||
nativeElem:new web2d.Group({width: 2, height:2,x: offset, y:offset, coordSizeWidth:1,coordSizeHeight:1})
|
||||
};
|
||||
this.updateIconGroupPosition();
|
||||
this.registerListeners();
|
||||
};
|
||||
|
||||
@@ -180,4 +180,19 @@ mindplot.IconGroup.prototype.registerListeners = function() {
|
||||
};
|
||||
mindplot.IconGroup.prototype.getTopic = function() {
|
||||
return this.options.topic;
|
||||
};
|
||||
|
||||
mindplot.IconGroup.prototype.updateIconGroupPosition = function() {
|
||||
var offsets = this._calculateOffsets();
|
||||
this.setPosition(offsets.x, offsets.y);
|
||||
};
|
||||
|
||||
mindplot.IconGroup.prototype._calculateOffsets = function() {
|
||||
var offset = this.options.topic.getOffset();
|
||||
var text = this.options.topic.getTextShape();
|
||||
var sizeHeight = text.getHtmlFontSize();
|
||||
var yOffset = offset;
|
||||
var shape = this.options.topic.getShapeType();
|
||||
yOffset = text.getPosition().y + (sizeHeight - 18)/2;
|
||||
return {x:offset, y:yOffset};
|
||||
};
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.IconModel = function(iconType, topic)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(iconModel, topic, designer) {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(urlModel, topic, designer) {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.LinkModel = function(url, topic)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.MainTopic = function(model)
|
||||
{
|
||||
core.assert(model, "Model can not be null");
|
||||
@@ -134,16 +133,23 @@ mindplot.MainTopic.prototype._defaultShapeType = function()
|
||||
mindplot.MainTopic.prototype.updateTopicShape = function(targetTopic, workspace)
|
||||
{
|
||||
// Change figure based on the connected topic ...
|
||||
var model = this.getModel();
|
||||
var shapeType = model.getShapeType();
|
||||
if (targetTopic.getType() != mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
var model = this.getModel();
|
||||
var shapeType = model.getShapeType();
|
||||
if (!shapeType)
|
||||
{
|
||||
// Get the real shape type ...
|
||||
shapeType = this.getShapeType();
|
||||
this._setShapeType(mindplot.NodeModel.SHAPE_TYPE_LINE, false);
|
||||
}else if(shapeType==mindplot.NodeModel.SHAPE_TYPE_LINE){
|
||||
var innerShape = this.getInnerShape();
|
||||
innerShape.setVisibility(false);
|
||||
|
||||
}
|
||||
} else {
|
||||
var innerShape = this.getInnerShape();
|
||||
innerShape.setVisibility(true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -160,6 +166,8 @@ mindplot.MainTopic.prototype.disconnect = function(workspace)
|
||||
shapeType = this.getShapeType();
|
||||
this._setShapeType(mindplot.NodeModel.SHAPE_TYPE_ROUNDED_RECT, false);
|
||||
}
|
||||
var innerShape = this.getInnerShape();
|
||||
innerShape.setVisibility(true);
|
||||
};
|
||||
|
||||
mindplot.MainTopic.prototype.getTopicType = function()
|
||||
@@ -253,6 +261,9 @@ mindplot.MainTopic.prototype.workoutOutgoingConnectionPoint = function(targetPos
|
||||
// In this case, connetion line is not used as shape figure.
|
||||
result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true);
|
||||
result.y = pos.y + (size.height / 2);
|
||||
/*if(result.y>0){
|
||||
result.y+=1;
|
||||
}*/
|
||||
|
||||
// Correction factor ...
|
||||
if (!isAtRight)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.MainTopicBoard = function(topic)
|
||||
{
|
||||
this._topic = topic;
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.Mindmap = function()
|
||||
{
|
||||
this._branches = [];
|
||||
this._name = null;
|
||||
this._description = null;
|
||||
this._version=null;
|
||||
this._relationships=[];
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.getCentralTopic = function()
|
||||
@@ -45,6 +46,20 @@ mindplot.Mindmap.prototype.setId = function(id)
|
||||
this._iconType = id;
|
||||
};
|
||||
|
||||
|
||||
mindplot.Mindmap.prototype.getVersion = function()
|
||||
{
|
||||
return this._version;
|
||||
};
|
||||
|
||||
|
||||
mindplot.Mindmap.prototype.setVersion = function(version)
|
||||
{
|
||||
this._version = version;
|
||||
};
|
||||
|
||||
|
||||
|
||||
mindplot.Mindmap.prototype.addBranch = function(nodeModel)
|
||||
{
|
||||
core.assert(nodeModel && nodeModel.isNodeModel(), 'Add node must be invoked with model objects');
|
||||
@@ -65,6 +80,10 @@ mindplot.Mindmap.prototype.getBranches = function()
|
||||
return this._branches;
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.getRelationships = function() {
|
||||
return this._relationships;
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.connect = function(parent, child)
|
||||
{
|
||||
// Child already has a parent ?
|
||||
@@ -120,6 +139,21 @@ mindplot.Mindmap.prototype._createNode = function(type)
|
||||
return result;
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.createRelationship = function(fromNode, toNode){
|
||||
core.assert(fromNode, 'from node cannot be null');
|
||||
core.assert(toNode, 'to node cannot be null');
|
||||
|
||||
return new mindplot.RelationshipModel(fromNode, toNode);
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.addRelationship = function(relationship) {
|
||||
this._relationships.push(relationship);
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.removeRelationship = function(relationship) {
|
||||
this._relationships.remove(relationship);
|
||||
};
|
||||
|
||||
mindplot.Mindmap.prototype.inspect = function()
|
||||
{
|
||||
var result = '';
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.MindmapDesigner = function(profile, divElement, persistanManager)
|
||||
mindplot.MindmapDesigner = function(profile, divElement)
|
||||
{
|
||||
core.assert(persistanManager, "Persistant manager must be defined");
|
||||
core.assert(core.Utils.isDefined(profile.zoom), "zoom must be defined");
|
||||
|
||||
// Undo manager ...
|
||||
@@ -47,17 +45,14 @@ mindplot.MindmapDesigner = function(profile, divElement, persistanManager)
|
||||
// Register handlers..
|
||||
this._registerEvents();
|
||||
|
||||
// Selected node
|
||||
this._nodeOnFocus = null;
|
||||
|
||||
// Init dragger manager.
|
||||
this._dragger = this._buildDragManager(workspace);
|
||||
|
||||
this._persistantManager = persistanManager;
|
||||
|
||||
// Add shapes to speed up the loading process ...
|
||||
mindplot.DragTopic.initialize(workspace);
|
||||
|
||||
this._relationships={};
|
||||
|
||||
this._events = {};
|
||||
};
|
||||
|
||||
@@ -184,7 +179,7 @@ mindplot.MindmapDesigner.prototype._registerEvents = function()
|
||||
var centralTopicId = centralTopic.getId();
|
||||
|
||||
// Execute action ...
|
||||
var command = new mindplot.commands.AddTopicCommand(model, centralTopicId);
|
||||
var command = new mindplot.commands.AddTopicCommand(model, centralTopicId, true);
|
||||
this._actionRunner.execute(command);
|
||||
}.bind(this));
|
||||
}
|
||||
@@ -233,19 +228,19 @@ mindplot.MindmapDesigner.prototype._buildNodeGraph = function(model)
|
||||
return topic;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.onNodeFocusEvent = function(topicGraph, event)
|
||||
mindplot.MindmapDesigner.prototype.onObjectFocusEvent = function(currentObject, event)
|
||||
{
|
||||
this.getEditor().lostFocus();
|
||||
var topics = this._topics;
|
||||
var selectableObjects = this.getSelectedObjects();
|
||||
// Disable all nodes on focus but not the current if Ctrl key isn't being pressed
|
||||
if (!core.Utils.isDefined(event) || event.ctrlKey == false)
|
||||
{
|
||||
for (var i = 0; i < topics.length; i++)
|
||||
for (var i = 0; i < selectableObjects.length; i++)
|
||||
{
|
||||
var node = topics[i];
|
||||
if (node.isOnFocus() && node != topicGraph)
|
||||
var selectableObject = selectableObjects[i];
|
||||
if (selectableObject.isOnFocus() && selectableObject != currentObject)
|
||||
{
|
||||
node.setOnFocus(false);
|
||||
selectableObject.setOnFocus(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +253,7 @@ mindplot.MindmapDesigner.prototype._registerListenersOnNode = function(topic)
|
||||
var topics = this._topics;
|
||||
topic.addEventListener('onfocus', function(event)
|
||||
{
|
||||
elem.onNodeFocusEvent.attempt([topic, event], elem);
|
||||
elem.onObjectFocusEvent.attempt([topic, event], elem);
|
||||
});
|
||||
|
||||
// Add drag behaviour ...
|
||||
@@ -330,7 +325,7 @@ mindplot.MindmapDesigner.prototype.createChildForSelectedNode = function()
|
||||
var parentTopicId = centalTopic.getId();
|
||||
var childModel = centalTopic.createChildModel();
|
||||
|
||||
var command = new mindplot.commands.AddTopicCommand(childModel, parentTopicId);
|
||||
var command = new mindplot.commands.AddTopicCommand(childModel, parentTopicId, true);
|
||||
this._actionRunner.execute(command);
|
||||
};
|
||||
|
||||
@@ -362,12 +357,68 @@ mindplot.MindmapDesigner.prototype.createSiblingForSelectedNode = function()
|
||||
var parentTopic = topic.getOutgoingConnectedTopic();
|
||||
var siblingModel = topic.createSiblingModel();
|
||||
var parentTopicId = parentTopic.getId();
|
||||
var command = new mindplot.commands.AddTopicCommand(siblingModel, parentTopicId);
|
||||
var command = new mindplot.commands.AddTopicCommand(siblingModel, parentTopicId, true);
|
||||
|
||||
this._actionRunner.execute(command);
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.addRelationShip2SelectedNode = function(event)
|
||||
{
|
||||
var screen = this._workspace.getScreenManager();
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
var selectedTopics = this.getSelectedNodes();
|
||||
if(selectedTopics.length >0){
|
||||
var fromNodePosition = selectedTopics[0].getPosition();
|
||||
this._relationship = new web2d.CurvedLine();
|
||||
this._relationship.setStyle(web2d.CurvedLine.SIMPLE_LINE);
|
||||
this._relationship.setDashed(2,2);
|
||||
this._relationship.setFrom(fromNodePosition.x, fromNodePosition.y);
|
||||
this._relationship.setTo(pos.x, pos.y);
|
||||
this._workspace.appendChild(this._relationship);
|
||||
this._relationshipMouseMoveFunction = this._relationshipMouseMove.bindWithEvent(this);
|
||||
this._relationshipMouseClickFunction = this._relationshipMouseClick.bindWithEvent(this, selectedTopics[0]);
|
||||
this._workspace.getScreenManager().addEventListener('mousemove',this._relationshipMouseMoveFunction);
|
||||
this._workspace.getScreenManager().addEventListener('click',this._relationshipMouseClickFunction);
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._relationshipMouseMove = function(event){
|
||||
var screen = this._workspace.getScreenManager();
|
||||
var pos = screen.getWorkspaceMousePosition(event);
|
||||
this._relationship.setTo(pos.x-1, pos.y-1); //to prevent click event target to be the line itself
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
return false;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._relationshipMouseClick = function (event, fromNode) {
|
||||
var target = event.target;
|
||||
while(target.tagName != "g" && core.Utils.isDefined(target.parentNode)){
|
||||
target=target.parentNode;
|
||||
}
|
||||
if(core.Utils.isDefined(target.virtualRef)){
|
||||
var targetNode = target.virtualRef;
|
||||
this.addRelationship(fromNode, targetNode);
|
||||
}
|
||||
this._workspace.removeChild(this._relationship);
|
||||
this._relationship = null;
|
||||
this._workspace.getScreenManager().removeEventListener('mousemove',this._relationshipMouseMoveFunction);
|
||||
this._workspace.getScreenManager().removeEventListener('click',this._relationshipMouseClickFunction);
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
return false;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.addRelationship= function(fromNode, toNode){
|
||||
// Create a new topic model ...
|
||||
var mindmap = this.getMindmap();
|
||||
var model = mindmap.createRelationship(fromNode.getModel().getId(), toNode.getModel().getId());
|
||||
|
||||
var command = new mindplot.commands.AddRelationshipCommand(model, mindmap);
|
||||
this._actionRunner.execute(command);
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.needsSave = function()
|
||||
{
|
||||
return this._actionRunner.hasBeenChanged();
|
||||
@@ -390,7 +441,7 @@ mindplot.MindmapDesigner.prototype.autoSaveEnabled = function(value)
|
||||
|
||||
mindplot.MindmapDesigner.prototype.save = function(onSavedHandler, saveHistory)
|
||||
{
|
||||
var persistantManager = this._persistantManager;
|
||||
var persistantManager = mindplot.PersistanceManager;
|
||||
var mindmap = this._mindmap;
|
||||
|
||||
var xmlChart = this._workspace.dumpNativeChart();
|
||||
@@ -417,7 +468,7 @@ mindplot.MindmapDesigner.prototype.loadFromXML = function(mapId, xmlContent)
|
||||
// Explorer Hack with local files ...
|
||||
var domDocument = core.Utils.createDocumentFromText(xmlContent);
|
||||
|
||||
var serializer = new mindplot.XMLMindmapSerializer();
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
var mindmap = serializer.loadFromDom(domDocument);
|
||||
|
||||
this._loadMap(mapId, mindmap);
|
||||
@@ -435,7 +486,7 @@ mindplot.MindmapDesigner.prototype.load = function(mapId)
|
||||
core.assert(mapId, 'mapName can not be null');
|
||||
|
||||
// Build load function ...
|
||||
var persistantManager = this._persistantManager;
|
||||
var persistantManager = mindplot.PersistanceManager;
|
||||
|
||||
// Loading mindmap ...
|
||||
var mindmap = persistantManager.load(mapId);
|
||||
@@ -469,6 +520,10 @@ mindplot.MindmapDesigner.prototype._loadMap = function(mapId, mindmapModel)
|
||||
// Update shrink render state...
|
||||
nodeGraph.setBranchVisibility(true);
|
||||
}
|
||||
var relationships = mindmapModel.getRelationships();
|
||||
for (var j=0; j<relationships.length; j++) {
|
||||
var relationship = this._relationshipModelToRelationship(relationships[j]);
|
||||
}
|
||||
}
|
||||
this._fireEvent("loadsuccess");
|
||||
|
||||
@@ -490,15 +545,18 @@ mindplot.MindmapDesigner.prototype.redo = function()
|
||||
this._actionRunner.redo();
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel)
|
||||
mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel, isVisible)
|
||||
{
|
||||
core.assert(nodeModel, "Node model can not be null");
|
||||
var nodeGraph = this._buildNodeGraph(nodeModel);
|
||||
|
||||
if(core.Utils.isDefined(isVisible))
|
||||
nodeGraph.setVisibility(isVisible);
|
||||
|
||||
var children = nodeModel.getChildren().slice();
|
||||
|
||||
// Sort children by order to solve adding order ...
|
||||
if (children.length > 0)
|
||||
if (nodeGraph.getTopicType()!=mindplot.NodeModel.CENTRAL_TOPIC_TYPE && children.length > 0)
|
||||
{
|
||||
var oldChildren = children;
|
||||
children = [];
|
||||
@@ -519,7 +577,8 @@ mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel)
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
this._nodeModelToNodeGraph(children[i]);
|
||||
if(core.Utils.isDefined(child))
|
||||
this._nodeModelToNodeGraph(child);
|
||||
}
|
||||
|
||||
var workspace = this._workspace;
|
||||
@@ -527,6 +586,93 @@ mindplot.MindmapDesigner.prototype._nodeModelToNodeGraph = function(nodeModel)
|
||||
return nodeGraph;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._relationshipModelToRelationship = function(model) {
|
||||
core.assert(model, "Node model can not be null");
|
||||
var relationship = this._buildRelationship(model);
|
||||
var sourceTopic = relationship.getSourceTopic();
|
||||
sourceTopic.addRelationship(relationship);
|
||||
var targetTopic = relationship.getTargetTopic();
|
||||
targetTopic.addRelationship(relationship);
|
||||
relationship.setVisibility(sourceTopic.isVisible() && targetTopic.isVisible());
|
||||
var workspace = this._workspace;
|
||||
workspace.appendChild(relationship);
|
||||
relationship.redraw();
|
||||
return relationship;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.createRelationship= function(model){
|
||||
this._mindmap.addRelationship(model);
|
||||
return this._relationshipModelToRelationship(model);
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.removeRelationship = function(model) {
|
||||
this._mindmap.removeRelationship(model);
|
||||
var relationship = this._relationships[model.getId()];
|
||||
var sourceTopic = relationship.getSourceTopic();
|
||||
sourceTopic.removeRelationship(relationship);
|
||||
var targetTopic = relationship.getTargetTopic();
|
||||
targetTopic.removeRelationship(relationship);
|
||||
this._workspace.removeChild(relationship);
|
||||
delete this._relationships[model.getId()];
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._buildRelationship = function (model) {
|
||||
var workspace = this._workspace;
|
||||
var elem = this;
|
||||
|
||||
var fromNodeId = model.getFromNode();
|
||||
var toNodeId = model.getToNode();
|
||||
|
||||
var fromTopic = null;
|
||||
var toTopic = null;
|
||||
var topics = this._topics;
|
||||
|
||||
for (var i = 0; i < topics.length; i++)
|
||||
{
|
||||
var t = topics[i];
|
||||
if (t.getModel().getId() == fromNodeId)
|
||||
{
|
||||
fromTopic= t;
|
||||
}
|
||||
if (t.getModel().getId() == toNodeId)
|
||||
{
|
||||
toTopic= t;
|
||||
}
|
||||
if(toTopic!=null && fromTopic!=null){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Create node graph ...
|
||||
var relationLine = new mindplot.RelationshipLine(fromTopic, toTopic, model.getLineType());
|
||||
if(core.Utils.isDefined(model.getSrcCtrlPoint())){
|
||||
var srcPoint = model.getSrcCtrlPoint().clone();
|
||||
relationLine.setSrcControlPoint(srcPoint);
|
||||
}
|
||||
if(core.Utils.isDefined(model.getDestCtrlPoint())){
|
||||
var destPoint = model.getDestCtrlPoint().clone();
|
||||
relationLine.setDestControlPoint(destPoint);
|
||||
}
|
||||
|
||||
|
||||
relationLine.getLine().setDashed(3,2);
|
||||
relationLine.setShowEndArrow(model.getEndArrow());
|
||||
relationLine.setShowStartArrow(model.getStartArrow());
|
||||
relationLine.setModel(model);
|
||||
|
||||
//Add Listeners
|
||||
var elem = this;
|
||||
relationLine.addEventListener('onfocus', function(event)
|
||||
{
|
||||
elem.onObjectFocusEvent.attempt([relationLine, event], elem);
|
||||
});
|
||||
|
||||
// Append it to the workspace ...
|
||||
this._relationships[model.getId()]=relationLine;
|
||||
|
||||
return relationLine;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.getEditor = function()
|
||||
{
|
||||
return this._editor;
|
||||
@@ -562,14 +708,14 @@ mindplot.MindmapDesigner.prototype._removeNode = function(node)
|
||||
mindplot.MindmapDesigner.prototype.deleteCurrentNode = function()
|
||||
{
|
||||
|
||||
var validateFunc = function(topic) {
|
||||
return topic.getTopicType() != mindplot.NodeModel.CENTRAL_TOPIC_TYPE
|
||||
var validateFunc = function(selectedObject) {
|
||||
return selectedObject.getType() == mindplot.RelationshipLine.type || selectedObject.getTopicType() != mindplot.NodeModel.CENTRAL_TOPIC_TYPE
|
||||
};
|
||||
var validateError = 'Central topic can not be deleted.';
|
||||
var topicsIds = this._setValidSelectedTopicsIds(validateFunc, validateError);
|
||||
if (topicsIds.length > 0)
|
||||
var selectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);
|
||||
if (selectedObjects.nodes.length > 0 || selectedObjects.relationshipLines.length>0)
|
||||
{
|
||||
var command = new mindplot.commands.DeleteTopicCommand(topicsIds);
|
||||
var command = new mindplot.commands.DeleteTopicCommand(selectedObjects);
|
||||
this._actionRunner.execute(command);
|
||||
}
|
||||
|
||||
@@ -577,7 +723,8 @@ mindplot.MindmapDesigner.prototype.deleteCurrentNode = function()
|
||||
|
||||
mindplot.MindmapDesigner.prototype.setFont2SelectedNode = function(font)
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var commandFunc = function(topic, font)
|
||||
@@ -598,7 +745,8 @@ mindplot.MindmapDesigner.prototype.setFont2SelectedNode = function(font)
|
||||
|
||||
mindplot.MindmapDesigner.prototype.setStyle2SelectedNode = function()
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var commandFunc = function(topic)
|
||||
@@ -615,7 +763,8 @@ mindplot.MindmapDesigner.prototype.setStyle2SelectedNode = function()
|
||||
|
||||
mindplot.MindmapDesigner.prototype.setFontColor2SelectedNode = function(color)
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var commandFunc = function(topic, color)
|
||||
@@ -637,7 +786,8 @@ mindplot.MindmapDesigner.prototype.setBackColor2SelectedNode = function(color)
|
||||
return topic.getShapeType() != mindplot.NodeModel.SHAPE_TYPE_LINE
|
||||
};
|
||||
var validateError = 'Color can not be setted to line topics.';
|
||||
var topicsIds = this._setValidSelectedTopicsIds(validateFunc, validateError);
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);;
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
@@ -654,19 +804,20 @@ mindplot.MindmapDesigner.prototype.setBackColor2SelectedNode = function(color)
|
||||
};
|
||||
|
||||
|
||||
mindplot.MindmapDesigner.prototype._setValidSelectedTopicsIds = function(validate, errorMsg)
|
||||
mindplot.MindmapDesigner.prototype._getValidSelectedObjectsIds = function(validate, errorMsg)
|
||||
{
|
||||
var result = [];
|
||||
var result = {"nodes":[],"relationshipLines":[]};
|
||||
var selectedNodes = this._getSelectedNodes();
|
||||
if (selectedNodes.length == 0)
|
||||
var selectedRelationshipLines = this.getSelectedRelationshipLines();
|
||||
if (selectedNodes.length == 0 && selectedRelationshipLines.length == 0)
|
||||
{
|
||||
core.Monitor.getInstance().logMessage('At least one topic must be selected to execute this operation.');
|
||||
core.Monitor.getInstance().logMessage('At least one element must be selected to execute this operation.');
|
||||
} else
|
||||
{
|
||||
var isValid = true;
|
||||
for (var i = 0; i < selectedNodes.length; i++)
|
||||
{
|
||||
var selectedNode = selectedNodes[i];
|
||||
var isValid = true;
|
||||
if (validate)
|
||||
{
|
||||
isValid = validate(selectedNode);
|
||||
@@ -675,7 +826,21 @@ mindplot.MindmapDesigner.prototype._setValidSelectedTopicsIds = function(validat
|
||||
// Add node only if it's valid.
|
||||
if (isValid)
|
||||
{
|
||||
result.push(selectedNode.getId());
|
||||
result.nodes.push(selectedNode.getId());
|
||||
} else
|
||||
{
|
||||
core.Monitor.getInstance().logMessage(errorMsg);
|
||||
}
|
||||
}
|
||||
for( var j = 0; j< selectedRelationshipLines.length; j++){
|
||||
var selectedLine = selectedRelationshipLines[j];
|
||||
isValid = true;
|
||||
if(validate){
|
||||
isValid = validate(selectedLine);
|
||||
}
|
||||
|
||||
if(isValid){
|
||||
result.relationshipLines.push(selectedLine.getId());
|
||||
} else
|
||||
{
|
||||
core.Monitor.getInstance().logMessage(errorMsg);
|
||||
@@ -691,7 +856,8 @@ mindplot.MindmapDesigner.prototype.setBorderColor2SelectedNode = function(color)
|
||||
return topic.getShapeType() != mindplot.NodeModel.SHAPE_TYPE_LINE
|
||||
};
|
||||
var validateError = 'Color can not be setted to line topics.';
|
||||
var topicsIds = this._setValidSelectedTopicsIds(validateFunc, validateError);
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);;
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
@@ -709,7 +875,8 @@ mindplot.MindmapDesigner.prototype.setBorderColor2SelectedNode = function(color)
|
||||
|
||||
mindplot.MindmapDesigner.prototype.setFontSize2SelectedNode = function(size)
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var commandFunc = function(topic, size)
|
||||
@@ -734,7 +901,8 @@ mindplot.MindmapDesigner.prototype.setShape2SelectedNode = function(shape)
|
||||
return !(topic.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.NodeModel.SHAPE_TYPE_LINE)
|
||||
};
|
||||
var validateError = 'Central Topic shape can not be changed to line figure.';
|
||||
var topicsIds = this._setValidSelectedTopicsIds(validateFunc, validateError);
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds(validateFunc, validateError);
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
@@ -752,7 +920,8 @@ mindplot.MindmapDesigner.prototype.setShape2SelectedNode = function(shape)
|
||||
|
||||
mindplot.MindmapDesigner.prototype.setWeight2SelectedNode = function()
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var commandFunc = function(topic)
|
||||
@@ -774,8 +943,8 @@ mindplot.MindmapDesigner.prototype.setWeight2SelectedNode = function()
|
||||
|
||||
mindplot.MindmapDesigner.prototype.addImage2SelectedNode = function(iconType)
|
||||
{
|
||||
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
|
||||
@@ -786,7 +955,8 @@ mindplot.MindmapDesigner.prototype.addImage2SelectedNode = function(iconType)
|
||||
|
||||
mindplot.MindmapDesigner.prototype.addLink2Node = function(url)
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var command = new mindplot.commands.AddLinkToTopicCommand(topicsIds[0], url);
|
||||
@@ -846,7 +1016,8 @@ mindplot.MindmapDesigner.prototype.addLink2SelectedNode = function()
|
||||
|
||||
mindplot.MindmapDesigner.prototype.addNote2Node = function(text)
|
||||
{
|
||||
var topicsIds = this._setValidSelectedTopicsIds();
|
||||
var validSelectedObjects = this._getValidSelectedObjectsIds();
|
||||
var topicsIds = validSelectedObjects.nodes;
|
||||
if (topicsIds.length > 0)
|
||||
{
|
||||
var command = new mindplot.commands.AddNoteToTopicCommand(topicsIds[0], text);
|
||||
@@ -939,11 +1110,31 @@ mindplot.MindmapDesigner.prototype._getSelectedNodes = function()
|
||||
return result;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.getSelectedRelationshipLines = function(){
|
||||
var result = new Array();
|
||||
for (var id in this._relationships)
|
||||
{
|
||||
var relationship = this._relationships[id];
|
||||
if (relationship.isOnFocus())
|
||||
{
|
||||
result.push(relationship);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.getSelectedNodes = function()
|
||||
{
|
||||
return this._getSelectedNodes();
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.getSelectedObjects = function()
|
||||
{
|
||||
var selectedNodes = this.getSelectedNodes();
|
||||
var selectedRelationships = this.getSelectedRelationshipLines();
|
||||
selectedRelationships.extend(selectedNodes);
|
||||
return selectedRelationships;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.keyEventHandler = function(event)
|
||||
{
|
||||
@@ -1168,7 +1359,7 @@ mindplot.MindmapDesigner.prototype._goToBrother = function(node, direction)
|
||||
mindplot.MindmapDesigner.prototype._goToNode = function(node)
|
||||
{
|
||||
node.setOnFocus(true);
|
||||
this.onNodeFocusEvent.attempt(node, this);
|
||||
this.onObjectFocusEvent.attempt(node, this);
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype._goToSideChild = function(node, side)
|
||||
@@ -1234,3 +1425,14 @@ mindplot.MindmapDesigner.prototype.getWorkSpace = function()
|
||||
{
|
||||
return this._workspace;
|
||||
};
|
||||
|
||||
mindplot.MindmapDesigner.prototype.findRelationShipsByTopicId = function(topicId){
|
||||
var result = [];
|
||||
for(var relationshipId in this._relationships){
|
||||
var relationship = this._relationships[relationshipId];
|
||||
if(relationship.getModel().getFromNode()==topicId || relationship.getModel().getToNode()==topicId){
|
||||
result.push(relationship);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
21
mindplot/src/main/javascript/ModelCodeName.js
Normal file
21
mindplot/src/main/javascript/ModelCodeName.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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.ModelCodeName ={};
|
||||
|
||||
mindplot.ModelCodeName.BETA = "beta";
|
||||
mindplot.ModelCodeName.PELA = "pela";
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.NodeGraph = function(nodeModel)
|
||||
{
|
||||
this._mouseEvents = true;
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.NodeModel = function(type, mindmap)
|
||||
{
|
||||
core.assert(type, 'Node type can not be null');
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.Note = function(textModel, topic, designer) {
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.NoteModel = function(text, topic)
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.PersistanceManager = function(editorService)
|
||||
{
|
||||
this._editorService = editorService;
|
||||
this._serializer = new mindplot.XMLMindmapSerializer();
|
||||
};
|
||||
mindplot.PersistanceManager = {};
|
||||
|
||||
mindplot.PersistanceManager.prototype.save = function(mindmap, chartType, xmlChart, editorProperties, onSavedHandler,saveHistory)
|
||||
mindplot.PersistanceManager.save = function(mindmap, chartType, xmlChart, editorProperties, onSavedHandler,saveHistory)
|
||||
{
|
||||
core.assert(mindmap, "mindmap can not be null");
|
||||
core.assert(chartType, "chartType can not be null");
|
||||
@@ -32,11 +27,12 @@ mindplot.PersistanceManager.prototype.save = function(mindmap, chartType, xmlCha
|
||||
|
||||
var mapId = mindmap.getId();
|
||||
|
||||
var xmlMap = this._serializer.toXML(mindmap);
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap(mindmap);
|
||||
var xmlMap = serializer.toXML(mindmap);
|
||||
var xmlMapStr = core.Utils.innerXML(xmlMap);
|
||||
|
||||
var pref = Json.toString(editorProperties);
|
||||
this._editorService.saveMap(mapId, xmlMapStr, chartType, xmlChart, pref,saveHistory,
|
||||
window.MapEditorService.saveMap(mapId, xmlMapStr, chartType, xmlChart, pref,saveHistory,
|
||||
{
|
||||
callback:function(response) {
|
||||
|
||||
@@ -64,14 +60,12 @@ mindplot.PersistanceManager.prototype.save = function(mindmap, chartType, xmlCha
|
||||
|
||||
};
|
||||
|
||||
mindplot.PersistanceManager.prototype.load = function(mapId)
|
||||
mindplot.PersistanceManager.load = function(mapId)
|
||||
{
|
||||
core.assert(mapId, "mapId can not be null");
|
||||
|
||||
var deserializer = this;
|
||||
var result = {r:null};
|
||||
var serializer = this._serializer;
|
||||
this._editorService.loadMap(mapId, {
|
||||
window.MapEditorService.loadMap(mapId, {
|
||||
callback:function(response) {
|
||||
|
||||
if (response.msgCode == "OK")
|
||||
@@ -79,6 +73,7 @@ mindplot.PersistanceManager.prototype.load = function(mapId)
|
||||
// Explorer Hack with local files ...
|
||||
var xmlContent = response.content;
|
||||
var domDocument = core.Utils.createDocumentFromText(xmlContent);
|
||||
var serializer = mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument(domDocument);
|
||||
var mindmap = serializer.loadFromDom(domDocument);
|
||||
mindmap.setId(mapId);
|
||||
|
||||
|
||||
281
mindplot/src/main/javascript/RelationshipLine.js
Normal file
281
mindplot/src/main/javascript/RelationshipLine.js
Normal file
@@ -0,0 +1,281 @@
|
||||
/*
|
||||
* 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.RelationshipLine = function(sourceNode, targetNode, lineType)
|
||||
{
|
||||
mindplot.ConnectionLine.call(this,sourceNode, targetNode, lineType);
|
||||
this._isOnfocus = false;
|
||||
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();
|
||||
|
||||
var strokeColor = mindplot.RelationshipLine.getStrokeColor();
|
||||
this._startArrow = new web2d.Arrow();
|
||||
this._endArrow = new web2d.Arrow();
|
||||
this._startArrow.setStrokeColor(strokeColor);
|
||||
this._startArrow.setStrokeWidth(2);
|
||||
this._endArrow.setStrokeColor(strokeColor);
|
||||
this._endArrow.setStrokeWidth(2);
|
||||
this._line2d.setStroke(1, 'solid', strokeColor);
|
||||
|
||||
};
|
||||
|
||||
objects.extend(mindplot.RelationshipLine, mindplot.ConnectionLine);
|
||||
|
||||
mindplot.RelationshipLine.getStrokeColor = function()
|
||||
{
|
||||
return '#9b74e6';
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setStroke = function(color, style, opacity)
|
||||
{
|
||||
mindplot.RelationshipLine.superClass.setStroke.call(this, color, style, opacity);
|
||||
this._startArrow.setStrokeColor(color);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.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;
|
||||
this._line2d.setStroke(2);
|
||||
var ctrlPoints = this._line2d.getControlPoints();
|
||||
if(!core.Utils.isDefined(ctrlPoints[0].x) || !core.Utils.isDefined(ctrlPoints[1].x)){
|
||||
var defaultPoints = core.Utils.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 = core.Utils.calculateRelationShipPointCoordinates(sourceTopic,spoint);
|
||||
tPos = core.Utils.calculateRelationShipPointCoordinates(targetTopic,tpoint);
|
||||
|
||||
line2d.setFrom(sPos.x, sPos.y);
|
||||
line2d.setTo(tPos.x, tPos.y);
|
||||
|
||||
line2d.moveToBack();
|
||||
|
||||
//Positionate Arrows
|
||||
this._positionateArrows();
|
||||
|
||||
// Add connector ...
|
||||
this._positionateConnector(targetTopic);
|
||||
|
||||
if(this.isOnFocus()){
|
||||
this._refreshSelectedShape();
|
||||
}
|
||||
this._focusShape.moveToBack();
|
||||
this._controlPointsController.redraw();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype._positionateArrows = function()
|
||||
{
|
||||
this._endArrow.setVisibility(this.isVisible() && this._showEndArrow);
|
||||
this._startArrow.setVisibility(this.isVisible() && this._showStartArrow);
|
||||
|
||||
var tpos = this._line2d.getTo();
|
||||
this._endArrow.setFrom(tpos.x, tpos.y);
|
||||
var spos = this._line2d.getFrom();
|
||||
this._startArrow.setFrom(spos.x, spos.y);
|
||||
this._endArrow.moveToBack();
|
||||
this._startArrow.moveToBack();
|
||||
|
||||
if(this._line2d.getType() == "CurvedLine"){
|
||||
var controlPoints = this._line2d.getControlPoints();
|
||||
this._startArrow.setControlPoint(controlPoints[0]);
|
||||
this._endArrow.setControlPoint(controlPoints[1]);
|
||||
} else {
|
||||
this._startArrow.setControlPoint(this._line2d.getTo());
|
||||
this._endArrow.setControlPoint(this._line2d.getFrom());
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.addToWorkspace = function(workspace)
|
||||
{
|
||||
workspace.appendChild(this._focusShape);
|
||||
workspace.appendChild(this._controlPointsController);
|
||||
this._controlPointControllerListener =this._initializeControlPointController.bindWithEvent(this,workspace);
|
||||
this._line2d.addEventListener('click', this._controlPointControllerListener);
|
||||
this._isInWorkspace = true;
|
||||
|
||||
workspace.appendChild(this._startArrow);
|
||||
workspace.appendChild(this._endArrow);
|
||||
|
||||
mindplot.RelationshipLine.superClass.addToWorkspace.call(this, workspace);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype._initializeControlPointController = function(event,workspace){
|
||||
this.setOnFocus(true);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.removeFromWorkspace = function(workspace){
|
||||
workspace.removeChild(this._focusShape);
|
||||
workspace.removeChild(this._controlPointsController);
|
||||
this._line2d.removeEventListener('click',this._controlPointControllerListener);
|
||||
this._isInWorkspace = false;
|
||||
workspace.removeChild(this._startArrow);
|
||||
workspace.removeChild(this._endArrow);
|
||||
|
||||
mindplot.RelationshipLine.superClass.removeFromWorkspace.call(this,workspace);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.getType = function(){
|
||||
return mindplot.RelationshipLine.type;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setOnFocus = function(focus){
|
||||
// Change focus shape
|
||||
if(focus){
|
||||
this._refreshSelectedShape();
|
||||
this._controlPointsController.setLine(this);
|
||||
}
|
||||
this._focusShape.setVisibility(focus);
|
||||
|
||||
this._controlPointsController.setVisibility(focus);
|
||||
this._onFocus = focus;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype._refreshSelectedShape = 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();
|
||||
//this._focusShape.setSrcControlPoint(ctrlPoints[0]);
|
||||
//this._focusShape.setDestControlPoint(ctrlPoints[1]);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.addEventListener = function(type, listener){
|
||||
// Translate to web 2d events ...
|
||||
if (type == 'onfocus')
|
||||
{
|
||||
type = 'mousedown';
|
||||
}
|
||||
|
||||
var line = this._line2d;
|
||||
line.addEventListener(type, listener);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isOnFocus = function()
|
||||
{
|
||||
return this._onFocus;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isInWorkspace = function(){
|
||||
return this._isInWorkspace;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setVisibility = function(value)
|
||||
{
|
||||
mindplot.RelationshipLine.superClass.setVisibility.call(this,value);
|
||||
this._endArrow.setVisibility(this._showEndArrow && value);
|
||||
this._startArrow.setVisibility(this._showStartArrow && value);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setOpacity = function(opacity){
|
||||
mindplot.RelationshipLine.superClass.setOpacity.call(this,opacity);
|
||||
if(this._showEndArrow)
|
||||
this._endArrow.setOpacity(opacity);
|
||||
if(this._showStartArrow)
|
||||
this._startArrow.setOpacity(opacity);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setShowEndArrow = function(visible){
|
||||
this._showEndArrow = visible;
|
||||
if(this._isInWorkspace)
|
||||
this.redraw();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setShowStartArrow = function(visible){
|
||||
this._showStartArrow = visible;
|
||||
if(this._isInWorkspace)
|
||||
this.redraw();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isShowEndArrow = function(){
|
||||
return this._showEndArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isShowStartArrow = function(){
|
||||
return this._showStartArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setFrom = function(x,y){
|
||||
this._line2d.setFrom(x,y);
|
||||
this._startArrow.setFrom(x,y);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setTo = function(x,y){
|
||||
this._line2d.setTo(x,y);
|
||||
this._endArrow.setFrom(x,y);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setSrcControlPoint = function(control){
|
||||
this._line2d.setSrcControlPoint(control);
|
||||
this._startArrow.setControlPoint(control);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setDestControlPoint = function(control){
|
||||
this._line2d.setDestControlPoint(control);
|
||||
this._endArrow.setControlPoint(control);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.getControlPoints = function(){
|
||||
return this._line2d.getControlPoints();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isSrcControlPointCustom = function(){
|
||||
return this._line2d.isSrcControlPointCustom();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.isDestControlPointCustom = function(){
|
||||
return this._line2d.isDestControlPointCustom();
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setIsSrcControlPointCustom = function(isCustom){
|
||||
this._line2d.setIsSrcControlPointCustom(isCustom);
|
||||
};
|
||||
|
||||
mindplot.RelationshipLine.prototype.setIsDestControlPointCustom = function(isCustom){
|
||||
this._line2d.setIsDestControlPointCustom(isCustom);
|
||||
};
|
||||
|
||||
|
||||
mindplot.RelationshipLine.type = "RelationshipLine";
|
||||
116
mindplot/src/main/javascript/RelationshipModel.js
Normal file
116
mindplot/src/main/javascript/RelationshipModel.js
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 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.RelationshipModel = function(fromNode, toNode)
|
||||
{
|
||||
core.assert(fromNode, 'from node type can not be null');
|
||||
core.assert(toNode, 'to node type can not be null');
|
||||
|
||||
this._id = mindplot.RelationshipModel._nextUUID();
|
||||
this._fromNode = fromNode;
|
||||
this._toNode = toNode;
|
||||
this._lineType=mindplot.ConnectionLine.SIMPLE_CURVED;
|
||||
this._srcCtrlPoint=null;
|
||||
this._destCtrlPoint=null;
|
||||
this._endArrow=true;
|
||||
this._startArrow=false;
|
||||
this._ctrlPointRelative=false;
|
||||
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getFromNode=function(){
|
||||
return this._fromNode;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getToNode=function(){
|
||||
return this._toNode;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getId=function(){
|
||||
return this._id;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getLineType = function(){
|
||||
return this._lineType;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.setLineType = function(lineType){
|
||||
this._lineType = lineType;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getSrcCtrlPoint= function(){
|
||||
return this._srcCtrlPoint;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.setSrcCtrlPoint= function(srcCtrlPoint){
|
||||
this._srcCtrlPoint = srcCtrlPoint;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getDestCtrlPoint= function(){
|
||||
return this._destCtrlPoint;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.setDestCtrlPoint= function(destCtrlPoint){
|
||||
this._destCtrlPoint = destCtrlPoint;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getEndArrow= function(){
|
||||
return this._endArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.setEndArrow= function(endArrow){
|
||||
this._endArrow = endArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.getStartArrow= function(){
|
||||
return this._startArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.setStartArrow= function(startArrow){
|
||||
this._startArrow = startArrow;
|
||||
};
|
||||
|
||||
mindplot.RelationshipModel.prototype.clone = function(model){
|
||||
var result = new mindplot.RelationshipModel(this._fromNode, this._toNode);
|
||||
result._id = this._id;
|
||||
result._lineType = this._lineType;
|
||||
result._srcCtrlPoint = this._srcCtrlPoint;
|
||||
result._destCtrlPoint = this._destCtrlPoint;
|
||||
result._endArrow = this._endArrow;
|
||||
result._startArrow = this._startArrow;
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* @todo: This method must be implemented.
|
||||
*/
|
||||
mindplot.RelationshipModel._nextUUID = function()
|
||||
{
|
||||
if (!this._uuid)
|
||||
{
|
||||
this._uuid = 0;
|
||||
}
|
||||
|
||||
this._uuid = this._uuid + 1;
|
||||
return this._uuid;
|
||||
};
|
||||
|
||||
|
||||
mindplot.RelationshipModel.prototype.inspect = function()
|
||||
{
|
||||
return '(fromNode:' + this.getFromNode().getId() + ' , toNode: ' + this.getToNode().getId() + ')';
|
||||
};
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(width, height, divElement)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(topic)
|
||||
@@ -37,10 +36,10 @@ mindplot.ShirinkConnector = function(topic)
|
||||
{
|
||||
topic.setChildrenShrinked(isShrink);
|
||||
return !isShrink;
|
||||
}
|
||||
};
|
||||
|
||||
var command = new mindplot.commands.GenericFunctionCommand(commandFunc, isShrink, [topicId]);
|
||||
actionRunner.execute(command)
|
||||
actionRunner.execute(command);
|
||||
|
||||
new Event(event).stop();
|
||||
|
||||
@@ -95,6 +94,11 @@ mindplot.ShirinkConnector.prototype.setVisibility = function(value)
|
||||
this._elipse.setVisibility(value);
|
||||
}
|
||||
|
||||
mindplot.ShirinkConnector.prototype.setOpacity = function(opacity)
|
||||
{
|
||||
this._elipse.setOpacity(opacity);
|
||||
}
|
||||
|
||||
mindplot.ShirinkConnector.prototype.setFill = function(color)
|
||||
{
|
||||
this._fillColor = color;
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.TextEditor = function(screenManager,actionRunner)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.Tip = function(divContainer){
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.Topic = function()
|
||||
{
|
||||
mindplot.Topic.superClass.initialize.call(this);
|
||||
@@ -31,6 +30,8 @@ mindplot.Topic.prototype.initialize = function(topicBoard)
|
||||
this._children = [];
|
||||
this._parent = null;
|
||||
this._lastIconId = -1;
|
||||
this._relationships = [];
|
||||
this._isInWorkspace = false;
|
||||
|
||||
this._topicBoard = topicBoard;
|
||||
this._buildShape();
|
||||
@@ -419,6 +420,18 @@ mindplot.Topic.prototype.removeNote = function(){
|
||||
this._hasNote=false;
|
||||
}
|
||||
|
||||
mindplot.Topic.prototype.addRelationship = function(relationship){
|
||||
this._relationships.push(relationship);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.removeRelationship = function(relationship){
|
||||
this._relationships.remove(relationship);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.getRelationships = function(){
|
||||
return this._relationships;
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype._buildTextShape = function(disableEventsListeners)
|
||||
{
|
||||
var result = new web2d.Text();
|
||||
@@ -646,7 +659,7 @@ mindplot.Topic.prototype._setText = function(text, updateModel)
|
||||
{
|
||||
return function()
|
||||
{
|
||||
elem.updateNode();
|
||||
elem.updateNode();
|
||||
};
|
||||
};
|
||||
|
||||
@@ -741,6 +754,7 @@ mindplot.Topic.prototype._buildShape = function()
|
||||
{
|
||||
var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100};
|
||||
var group = new web2d.Group(groupAttributes);
|
||||
group._peer._native.virtualRef=this;
|
||||
this._set2DElement(group);
|
||||
|
||||
// Shape must be build based on the model width ...
|
||||
@@ -834,15 +848,8 @@ mindplot.Topic.prototype.setChildrenShrinked = function(value)
|
||||
var shrinkConnector = this.getShrinkConnector();
|
||||
shrinkConnector.changeRender(value);
|
||||
|
||||
// Hide branch in order to avoid flickering...
|
||||
this._setChildrenVisibility(false);
|
||||
|
||||
// Update topic position based on the state ...
|
||||
var targetTopicBoard = this.getTopicBoard();
|
||||
targetTopicBoard.repositionate();
|
||||
|
||||
// Hide children ...
|
||||
this._setChildrenVisibility(!value);
|
||||
core.Utils.setChildrenVisibilityAnimated(this, !value);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.getShrinkConnector = function()
|
||||
@@ -949,6 +956,11 @@ mindplot.Topic.prototype._updateConnectionLines = function()
|
||||
{
|
||||
incomingLines[i].redraw();
|
||||
}
|
||||
|
||||
// Update relationship lines
|
||||
for(var j=0; j<this._relationships.length; j++){
|
||||
this._relationships[j].redraw();
|
||||
}
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.setBranchVisibility = function(value)
|
||||
@@ -970,6 +982,20 @@ mindplot.Topic.prototype.setVisibility = function(value)
|
||||
|
||||
// Hide all children...
|
||||
this._setChildrenVisibility(value);
|
||||
|
||||
this._setRelationshipLinesVisibility(value);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.isVisible = function(){
|
||||
var elem = this.get2DElement();
|
||||
return elem.isVisible();
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype._setRelationshipLinesVisibility = function(value){
|
||||
//var relationships = designer.findRelationShipsByTopicId(this.getId());
|
||||
this._relationships.forEach(function(relationship, index){
|
||||
relationship.setVisibility(value);
|
||||
});
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype._setTopicVisibility = function(value)
|
||||
@@ -988,6 +1014,16 @@ mindplot.Topic.prototype._setTopicVisibility = function(value)
|
||||
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.setOpacity = function(opacity){
|
||||
var elem = this.get2DElement();
|
||||
elem.setOpacity(opacity);
|
||||
|
||||
this.getShrinkConnector().setOpacity(opacity);
|
||||
|
||||
var textShape = this .getTextShape();
|
||||
textShape.setOpacity(opacity);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype._setChildrenVisibility = function(isVisible)
|
||||
{
|
||||
|
||||
@@ -999,9 +1035,7 @@ mindplot.Topic.prototype._setChildrenVisibility = function(isVisible)
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
child._setChildrenVisibility(isVisible);
|
||||
|
||||
child._setTopicVisibility(isVisible);
|
||||
child.setVisibility(isVisible);
|
||||
|
||||
var outgoingLine = child.getOutgoingLine();
|
||||
outgoingLine.setVisibility(isVisible);
|
||||
@@ -1140,7 +1174,7 @@ mindplot.Topic.prototype.setOrder = function(value)
|
||||
model.setOrder(value);
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.connectTo = function(targetTopic, workspace)
|
||||
mindplot.Topic.prototype.connectTo = function(targetTopic, workspace, isVisible)
|
||||
{
|
||||
core.assert(!this._outgoingLine, 'Could not connect an already connected node');
|
||||
core.assert(targetTopic != this, 'Cilcular connection are not allowed');
|
||||
@@ -1149,6 +1183,8 @@ mindplot.Topic.prototype.connectTo = function(targetTopic, workspace)
|
||||
|
||||
// Create a connection line ...
|
||||
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
|
||||
if(core.Utils.isDefined(isVisible))
|
||||
outgoingLine.setVisibility(isVisible);
|
||||
this._outgoingLine = outgoingLine;
|
||||
workspace.appendChild(outgoingLine);
|
||||
|
||||
@@ -1222,12 +1258,18 @@ mindplot.Topic.prototype.removeFromWorkspace = function(workspace)
|
||||
{
|
||||
workspace.removeChild(line);
|
||||
}
|
||||
this._isInWorkspace=false;
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.addToWorkspace = function(workspace)
|
||||
{
|
||||
var elem = this.get2DElement();
|
||||
workspace.appendChild(elem);
|
||||
this._isInWorkspace=true;
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.isInWorkspace = function(){
|
||||
return this._isInWorkspace;
|
||||
};
|
||||
|
||||
mindplot.Topic.prototype.getTopicBoard = function()
|
||||
@@ -1250,16 +1292,29 @@ mindplot.Topic.prototype.createDragNode = function()
|
||||
|
||||
mindplot.Topic.prototype.updateNode = function()
|
||||
{
|
||||
var textShape = this.getTextShape();
|
||||
var sizeWidth = textShape.getWidth();
|
||||
var sizeHeight = textShape.getHeight();
|
||||
var font = textShape.getFont();
|
||||
var iconOffset = this.getIconOffset();
|
||||
if(this.isInWorkspace()){
|
||||
var textShape = this.getTextShape();
|
||||
var sizeWidth = textShape.getWidth();
|
||||
var sizeHeight = textShape.getHeight();
|
||||
var font = textShape.getFont();
|
||||
var iconOffset = this.getIconOffset();
|
||||
var height = sizeHeight + this._offset;
|
||||
var width = sizeWidth + this._offset*2 + iconOffset;
|
||||
var pos = this._offset /2;
|
||||
if(this.getShapeType()==mindplot.NodeModel.SHAPE_TYPE_ELIPSE){
|
||||
var factor = 0.25;
|
||||
height = (width*factor<height?height:width*factor);
|
||||
pos = (height-sizeHeight+3)/2;
|
||||
}
|
||||
|
||||
var newSize = {width:sizeWidth + this._offset*2 + iconOffset,height:sizeHeight + this._offset};
|
||||
this.setSize(newSize);
|
||||
var newSize = {width:width,height:height};
|
||||
this.setSize(newSize);
|
||||
|
||||
// Positionate node ...
|
||||
textShape.setPosition(iconOffset+this._offset, this._offset / 2);
|
||||
textShape.setTextSize(sizeWidth, sizeHeight);
|
||||
// Positionate node ...
|
||||
textShape.setPosition(iconOffset+this._offset, pos);
|
||||
textShape.setTextSize(sizeWidth, sizeHeight);
|
||||
var iconGroup = this.getIconGroup();
|
||||
if(core.Utils.isDefined(iconGroup))
|
||||
iconGroup.updateIconGroupPosition();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.TopicBoard = function()
|
||||
{
|
||||
this._height = null;
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.VariableDistanceBoard = function(defaultHeight, referencePoint)
|
||||
{
|
||||
mindplot.VariableDistanceBoard.superClass.initialize.call(this, defaultHeight, referencePoint);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = function(profile, screenManager, zoom)
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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.XMLMindmapSerializerFactory = {};
|
||||
|
||||
mindplot.XMLMindmapSerializerFactory.getSerializerFromMindmap = function(mindmap){
|
||||
return mindplot.XMLMindmapSerializerFactory.getSerializer(mindmap.getVersion());
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializerFactory.getSerializerFromDocument = function(domDocument){
|
||||
var rootElem = domDocument.documentElement;
|
||||
return mindplot.XMLMindmapSerializerFactory.getSerializer(rootElem.getAttribute("version"))
|
||||
};
|
||||
|
||||
|
||||
mindplot.XMLMindmapSerializerFactory.getSerializer = function(version){
|
||||
if(!core.Utils.isDefined(version)){
|
||||
version = mindplot.ModelCodeName.BETA;
|
||||
}
|
||||
var codeNames = mindplot.XMLMindmapSerializerFactory._codeNames;
|
||||
var found = false;
|
||||
var serializer = null;
|
||||
for(var i=0; i<codeNames.length; i++){
|
||||
if(!found){
|
||||
found = codeNames[i].codeName==version;
|
||||
if(found)
|
||||
serializer = new (codeNames[i].serializer)();
|
||||
} else{
|
||||
var migrator = codeNames[i].migrator;
|
||||
serializer = new migrator(serializer);
|
||||
}
|
||||
}
|
||||
|
||||
return serializer;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializerFactory._codeNames =
|
||||
[{
|
||||
codeName:mindplot.ModelCodeName.BETA,
|
||||
serializer: mindplot.XMLMindmapSerializer_Beta,
|
||||
migrator:function(){//todo:error
|
||||
}
|
||||
},
|
||||
{
|
||||
codeName:mindplot.ModelCodeName.PELA,
|
||||
serializer:mindplot.XMLMindmapSerializer_Pela,
|
||||
migrator:mindplot.Beta2PelaMigrator
|
||||
}
|
||||
];
|
||||
@@ -1,28 +1,25 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
/* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.XMLMindmapSerializer = function()
|
||||
mindplot.XMLMindmapSerializer_Beta = function()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype.toXML = function(mindmap)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype.toXML = function(mindmap)
|
||||
{
|
||||
core.assert(mindmap, "Can not save a null mindmap");
|
||||
|
||||
@@ -49,7 +46,7 @@ mindplot.XMLMindmapSerializer.prototype.toXML = function(mindmap)
|
||||
return document;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._topicToXML = function(document, topic)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._topicToXML = function(document, topic)
|
||||
{
|
||||
var parentTopic = document.createElement("topic");
|
||||
|
||||
@@ -158,37 +155,37 @@ mindplot.XMLMindmapSerializer.prototype._topicToXML = function(document, topic)
|
||||
return parentTopic;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._iconToXML = function(document, icon)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._iconToXML = function(document, icon)
|
||||
{
|
||||
var iconDom = document.createElement("icon");
|
||||
iconDom.setAttribute('id', icon.getIconType());
|
||||
return iconDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._linkToXML = function(document, link)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._linkToXML = function(document, link)
|
||||
{
|
||||
var linkDom = document.createElement("link");
|
||||
linkDom.setAttribute('url', link.getUrl());
|
||||
return linkDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._noteToXML = function(document, note)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._noteToXML = function(document, note)
|
||||
{
|
||||
var noteDom = document.createElement("note");
|
||||
noteDom.setAttribute('text', note.getText());
|
||||
return noteDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype.loadFromDom = function(dom)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype.loadFromDom = function(dom)
|
||||
{
|
||||
core.assert(dom, "Dom can not be null");
|
||||
var rootElem = dom.documentElement;
|
||||
|
||||
// Is a wisemap?.
|
||||
core.assert(rootElem.tagName == mindplot.XMLMindmapSerializer.MAP_ROOT_NODE, "This seem not to be a map document.");
|
||||
core.assert(rootElem.tagName == mindplot.XMLMindmapSerializer_Beta.MAP_ROOT_NODE, "This seem not to be a map document.");
|
||||
|
||||
// Start the loading process ...
|
||||
var mindmap = new mindplot.Mindmap();
|
||||
var mindmap = new mindplot.Mindmap();
|
||||
|
||||
var children = rootElem.childNodes;
|
||||
for (var i = 0; i < children.length; i++)
|
||||
@@ -203,7 +200,7 @@ mindplot.XMLMindmapSerializer.prototype.loadFromDom = function(dom)
|
||||
return mindmap;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._deserializeNode = function(domElem, mindmap)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNode = function(domElem, mindmap)
|
||||
{
|
||||
var type = (domElem.getAttribute('central') != null) ? mindplot.NodeModel.CENTRAL_TOPIC_TYPE : mindplot.NodeModel.MAIN_TOPIC_TYPE;
|
||||
var topic = mindmap.createNode(type);
|
||||
@@ -303,19 +300,19 @@ mindplot.XMLMindmapSerializer.prototype._deserializeNode = function(domElem, min
|
||||
return topic;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._deserializeIcon = function(domElem, topic)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._deserializeIcon = function(domElem, topic)
|
||||
{
|
||||
return topic.createIcon(domElem.getAttribute("id"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._deserializeLink = function(domElem, topic)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._deserializeLink = function(domElem, topic)
|
||||
{
|
||||
return topic.createLink(domElem.getAttribute("url"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.prototype._deserializeNote = function(domElem, topic)
|
||||
mindplot.XMLMindmapSerializer_Beta.prototype._deserializeNote = function(domElem, topic)
|
||||
{
|
||||
return topic.createNote(domElem.getAttribute("text"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer.MAP_ROOT_NODE = 'map';
|
||||
mindplot.XMLMindmapSerializer_Beta.MAP_ROOT_NODE = 'map';
|
||||
399
mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js
Normal file
399
mindplot/src/main/javascript/XMLMindmapSerializer_Pela.js
Normal file
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
* 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.XMLMindmapSerializer_Pela = function()
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype.toXML = function(mindmap)
|
||||
{
|
||||
core.assert(mindmap, "Can not save a null mindmap");
|
||||
|
||||
var document = core.Utils.createDocument();
|
||||
|
||||
// Store map attributes ...
|
||||
var mapElem = document.createElement("map");
|
||||
var name = mindmap.getId();
|
||||
if (name)
|
||||
{
|
||||
mapElem.setAttribute('name', name);
|
||||
}
|
||||
var version = mindmap.getVersion();
|
||||
if (version)
|
||||
{
|
||||
mapElem.setAttribute('version', version);
|
||||
}
|
||||
|
||||
document.appendChild(mapElem);
|
||||
|
||||
// Create branches ...
|
||||
var topics = mindmap.getBranches();
|
||||
for (var i = 0; i < topics.length; i++)
|
||||
{
|
||||
var topic = topics[i];
|
||||
var topicDom = this._topicToXML(document, topic);
|
||||
mapElem.appendChild(topicDom);
|
||||
}
|
||||
|
||||
// Create Relationships
|
||||
var relationships = mindmap.getRelationships();
|
||||
if(relationships.length>0){
|
||||
// var relationshipDom=document.createElement("relationships");
|
||||
// mapElem.appendChild(relationshipDom);
|
||||
for (var j = 0; j<relationships.length; j++){
|
||||
var relationDom = this._relationshipToXML(document, relationships[j]);
|
||||
mapElem.appendChild(relationDom);
|
||||
}
|
||||
}
|
||||
|
||||
return document;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._topicToXML = function(document, topic)
|
||||
{
|
||||
var parentTopic = document.createElement("topic");
|
||||
|
||||
// Set topic attributes...
|
||||
if (topic.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
parentTopic.setAttribute("central", true);
|
||||
} else
|
||||
{
|
||||
var parent = topic.getParent();
|
||||
if (parent == null || parent.getType() == mindplot.NodeModel.CENTRAL_TOPIC_TYPE)
|
||||
{
|
||||
var pos = topic.getPosition();
|
||||
parentTopic.setAttribute("position", pos.x + ',' + pos.y);
|
||||
} else
|
||||
{
|
||||
var order = topic.getOrder();
|
||||
parentTopic.setAttribute("order", order);
|
||||
}
|
||||
}
|
||||
|
||||
var text = topic.getText();
|
||||
if (text) {
|
||||
parentTopic.setAttribute('text', text);
|
||||
}
|
||||
|
||||
var shape = topic.getShapeType();
|
||||
if (shape) {
|
||||
parentTopic.setAttribute('shape', shape);
|
||||
}
|
||||
|
||||
if(topic.areChildrenShrinked())
|
||||
{
|
||||
parentTopic.setAttribute('shrink',true);
|
||||
}
|
||||
|
||||
// Font properties ...
|
||||
var id = topic.getId();
|
||||
parentTopic.setAttribute('id',id);
|
||||
|
||||
var font = "";
|
||||
|
||||
var fontFamily = topic.getFontFamily();
|
||||
font += (fontFamily ? fontFamily : '') + ';';
|
||||
|
||||
var fontSize = topic.getFontSize();
|
||||
font += (fontSize ? fontSize : '') + ';';
|
||||
|
||||
var fontColor = topic.getFontColor();
|
||||
font += (fontColor ? fontColor : '') + ';';
|
||||
|
||||
var fontWeight = topic.getFontWeight();
|
||||
font += (fontWeight ? fontWeight : '') + ';';
|
||||
|
||||
var fontStyle = topic.getFontStyle();
|
||||
font += (fontStyle ? fontStyle : '') + ';';
|
||||
|
||||
if (fontFamily || fontSize || fontColor || fontWeight || fontStyle)
|
||||
{
|
||||
parentTopic.setAttribute('fontStyle', font);
|
||||
}
|
||||
|
||||
var bgColor = topic.getBackgroundColor();
|
||||
if (bgColor) {
|
||||
parentTopic.setAttribute('bgColor', bgColor);
|
||||
}
|
||||
|
||||
var brColor = topic.getBorderColor();
|
||||
if (brColor) {
|
||||
parentTopic.setAttribute('brColor', brColor);
|
||||
}
|
||||
|
||||
//ICONS
|
||||
var icons = topic.getIcons();
|
||||
for (var i = 0; i < icons.length; i++)
|
||||
{
|
||||
var icon = icons[i];
|
||||
var iconDom = this._iconToXML(document, icon);
|
||||
parentTopic.appendChild(iconDom);
|
||||
}
|
||||
|
||||
//LINKS
|
||||
var links = topic.getLinks();
|
||||
for (var i = 0; i < links.length; i++)
|
||||
{
|
||||
var link = links[i];
|
||||
var linkDom = this._linkToXML(document, link);
|
||||
parentTopic.appendChild(linkDom);
|
||||
}
|
||||
|
||||
var notes = topic.getNotes();
|
||||
for (var i = 0; i < notes.length; i++)
|
||||
{
|
||||
var note = notes[i];
|
||||
var noteDom = this._noteToXML(document, note);
|
||||
parentTopic.appendChild(noteDom);
|
||||
}
|
||||
|
||||
//CHILDREN TOPICS
|
||||
var childTopics = topic.getChildren();
|
||||
for (var i = 0; i < childTopics.length; i++)
|
||||
{
|
||||
var childTopic = childTopics[i];
|
||||
var childDom = this._topicToXML(document, childTopic);
|
||||
parentTopic.appendChild(childDom);
|
||||
|
||||
}
|
||||
|
||||
return parentTopic;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._iconToXML = function(document, icon)
|
||||
{
|
||||
var iconDom = document.createElement("icon");
|
||||
iconDom.setAttribute('id', icon.getIconType());
|
||||
return iconDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._linkToXML = function(document, link)
|
||||
{
|
||||
var linkDom = document.createElement("link");
|
||||
linkDom.setAttribute('url', link.getUrl());
|
||||
return linkDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._noteToXML = function(document, note)
|
||||
{
|
||||
var noteDom = document.createElement("note");
|
||||
noteDom.setAttribute('text', note.getText());
|
||||
return noteDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._relationshipToXML = function(document,relationship){
|
||||
var relationDom = document.createElement("relationship");
|
||||
relationDom.setAttribute("srcTopicId",relationship.getFromNode());
|
||||
relationDom.setAttribute("destTopicId",relationship.getToNode());
|
||||
var lineType = relationship.getLineType();
|
||||
relationDom.setAttribute("lineType",lineType);
|
||||
if(lineType==mindplot.ConnectionLine.CURVED || lineType==mindplot.ConnectionLine.SIMPLE_CURVED){
|
||||
if(core.Utils.isDefined(relationship.getSrcCtrlPoint())){
|
||||
var srcPoint = relationship.getSrcCtrlPoint();
|
||||
relationDom.setAttribute("srcCtrlPoint",srcPoint.x+","+srcPoint.y);
|
||||
}
|
||||
if(core.Utils.isDefined(relationship.getDestCtrlPoint())){
|
||||
var destPoint = relationship.getDestCtrlPoint();
|
||||
relationDom.setAttribute("destCtrlPoint",destPoint.x+","+destPoint.y);
|
||||
}
|
||||
}
|
||||
relationDom.setAttribute("endArrow",relationship.getEndArrow());
|
||||
relationDom.setAttribute("startArrow",relationship.getStartArrow());
|
||||
return relationDom;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype.loadFromDom = function(dom)
|
||||
{
|
||||
core.assert(dom, "Dom can not be null");
|
||||
var rootElem = dom.documentElement;
|
||||
|
||||
// Is a wisemap?.
|
||||
core.assert(rootElem.tagName == mindplot.XMLMindmapSerializer_Pela.MAP_ROOT_NODE, "This seem not to be a map document.");
|
||||
|
||||
// Start the loading process ...
|
||||
var mindmap = new mindplot.Mindmap();
|
||||
|
||||
var version = rootElem.getAttribute("version");
|
||||
mindmap.setVersion(version);
|
||||
|
||||
var children = rootElem.childNodes;
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child.nodeType == 1)
|
||||
{
|
||||
switch(child.tagName){
|
||||
case "topic":
|
||||
var topic = this._deserializeNode(child, mindmap);
|
||||
mindmap.addBranch(topic);
|
||||
break;
|
||||
case "relationship":
|
||||
var relationship = this._deserializeRelationship(child,mindmap);
|
||||
mindmap.addRelationship(relationship);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return mindmap;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNode = function(domElem, mindmap)
|
||||
{
|
||||
var type = (domElem.getAttribute('central') != null) ? mindplot.NodeModel.CENTRAL_TOPIC_TYPE : mindplot.NodeModel.MAIN_TOPIC_TYPE;
|
||||
var topic = mindmap.createNode(type);
|
||||
|
||||
// Load attributes...
|
||||
var id = domElem.getAttribute('id');
|
||||
if(id) {
|
||||
topic.setId(id);
|
||||
}
|
||||
|
||||
var text = domElem.getAttribute('text');
|
||||
if (text) {
|
||||
topic.setText(text);
|
||||
}
|
||||
|
||||
var order = domElem.getAttribute('order');
|
||||
if (order) {
|
||||
topic.setOrder(order);
|
||||
}
|
||||
|
||||
var shape = domElem.getAttribute('shape');
|
||||
if (shape) {
|
||||
topic.setShapeType(shape);
|
||||
}
|
||||
|
||||
var isShrink = domElem.getAttribute('shrink');
|
||||
if(isShrink)
|
||||
{
|
||||
topic.setChildrenShrinked(isShrink);
|
||||
}
|
||||
|
||||
var fontStyle = domElem.getAttribute('fontStyle');
|
||||
if (fontStyle) {
|
||||
var font = fontStyle.split(';');
|
||||
|
||||
if (font[0])
|
||||
{
|
||||
topic.setFontFamily(font[0]);
|
||||
}
|
||||
|
||||
if (font[1])
|
||||
{
|
||||
topic.setFontSize(font[1]);
|
||||
}
|
||||
|
||||
if (font[2])
|
||||
{
|
||||
topic.setFontColor(font[2]);
|
||||
}
|
||||
|
||||
if (font[3])
|
||||
{
|
||||
topic.setFontWeight(font[3]);
|
||||
}
|
||||
|
||||
if (font[4])
|
||||
{
|
||||
topic.setFontStyle(font[4]);
|
||||
}
|
||||
}
|
||||
|
||||
var bgColor = domElem.getAttribute('bgColor');
|
||||
if (bgColor) {
|
||||
topic.setBackgroundColor(bgColor);
|
||||
}
|
||||
|
||||
var borderColor = domElem.getAttribute('brColor');
|
||||
if (borderColor) {
|
||||
topic.setBorderColor(borderColor);
|
||||
}
|
||||
|
||||
var position = domElem.getAttribute('position');
|
||||
if (position) {
|
||||
var pos = position.split(',');
|
||||
topic.setPosition(pos[0], pos[1]);
|
||||
}
|
||||
|
||||
//Creating icons and children nodes
|
||||
var children = domElem.childNodes;
|
||||
for (var i = 0; i < children.length; i++)
|
||||
{
|
||||
var child = children[i];
|
||||
if (child.nodeType == 1)
|
||||
{
|
||||
core.assert(child.tagName == "topic" || child.tagName == "icon" || child.tagName == "link" || child.tagName == "note", 'Illegal node type:' + child.tagName);
|
||||
if (child.tagName == "topic") {
|
||||
var childTopic = this._deserializeNode(child, mindmap);
|
||||
childTopic.connectTo(topic);
|
||||
} else if(child.tagName == "icon") {
|
||||
var icon = this._deserializeIcon(child, topic);
|
||||
topic.addIcon(icon);
|
||||
} else if(child.tagName == "link") {
|
||||
var link = this._deserializeLink(child, topic);
|
||||
topic.addLink(link);
|
||||
} else if(child.tagName == "note") {
|
||||
var note = this._deserializeNote(child, topic);
|
||||
topic.addNote(note);
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
return topic;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._deserializeIcon = function(domElem, topic)
|
||||
{
|
||||
return topic.createIcon(domElem.getAttribute("id"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._deserializeLink = function(domElem, topic)
|
||||
{
|
||||
return topic.createLink(domElem.getAttribute("url"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._deserializeNote = function(domElem, topic)
|
||||
{
|
||||
return topic.createNote(domElem.getAttribute("text"));
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.prototype._deserializeRelationship = function(domElement, mindmap)
|
||||
{
|
||||
var srcId = domElement.getAttribute("srcTopicId");
|
||||
var destId = domElement.getAttribute("destTopicId");
|
||||
var lineType = domElement.getAttribute("lineType");
|
||||
var srcCtrlPoint = domElement.getAttribute("srcCtrlPoint");
|
||||
var destCtrlPoint = domElement.getAttribute("destCtrlPoint");
|
||||
var endArrow = domElement.getAttribute("endArrow");
|
||||
var startArrow = domElement.getAttribute("startArrow");
|
||||
var model = mindmap.createRelationship(srcId, destId);
|
||||
model.setLineType(lineType);
|
||||
if(core.Utils.isDefined(srcCtrlPoint) && srcCtrlPoint!=""){
|
||||
model.setSrcCtrlPoint(core.Point.fromString(srcCtrlPoint));
|
||||
}
|
||||
if(core.Utils.isDefined(destCtrlPoint) && destCtrlPoint!=""){
|
||||
model.setDestCtrlPoint(core.Point.fromString(destCtrlPoint));
|
||||
}
|
||||
model.setEndArrow(endArrow=="true");
|
||||
model.setStartArrow(startArrow=="true");
|
||||
return model;
|
||||
};
|
||||
|
||||
mindplot.XMLMindmapSerializer_Pela.MAP_ROOT_NODE = 'map';
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.AddIconToTopicCommand = mindplot.Command.extend(
|
||||
@@ -23,12 +22,12 @@ mindplot.commands.AddIconToTopicCommand = mindplot.Command.extend(
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
core.assert(iconType, 'iconType can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._iconType = iconType;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
var iconImg = topic.addIcon(this._iconType, commandContext._designer);
|
||||
this._iconModel = iconImg.getModel();
|
||||
@@ -38,7 +37,7 @@ mindplot.commands.AddIconToTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeIcon(this._iconModel);
|
||||
topic.updateNode();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.AddLinkToTopicCommand = mindplot.Command.extend(
|
||||
@@ -22,13 +21,13 @@ mindplot.commands.AddLinkToTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicId,url)
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._url = url;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addLink(this._url,commandContext._designer);
|
||||
topic.updateNode();
|
||||
@@ -37,7 +36,7 @@ mindplot.commands.AddLinkToTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeLink();
|
||||
}.bind(this);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.AddNoteToTopicCommand = mindplot.Command.extend(
|
||||
@@ -22,13 +21,13 @@ mindplot.commands.AddNoteToTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicId,text)
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._text = text;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addNote(this._text,commandContext._designer);
|
||||
topic.updateNode();
|
||||
@@ -37,7 +36,7 @@ mindplot.commands.AddNoteToTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeNote();
|
||||
}.bind(this);
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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.commands.AddRelationshipCommand = mindplot.Command.extend(
|
||||
{
|
||||
initialize: function(model, mindmap)
|
||||
{
|
||||
core.assert(model, 'Relationship model can not be null');
|
||||
this._model = model;
|
||||
this._mindmap = mindmap;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var relationship = commandContext.createRelationship(this._model);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var relationship = commandContext.removeRelationship(this._model);
|
||||
this._mindmap.removeRelationship(this._model);
|
||||
}
|
||||
});
|
||||
@@ -1,51 +1,66 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = mindplot.Command.extend(
|
||||
{
|
||||
initialize: function(model, parentTopicId)
|
||||
initialize: function(model, parentTopicId, animated)
|
||||
{
|
||||
core.assert(model, 'Model can not be null');
|
||||
this._model = model;
|
||||
this._parentId = parentTopicId;
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
this._animated = core.Utils.isDefined(animated)?animated:false;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
// Add a new topic ...
|
||||
var topic = commandContext.createTopic(this._model);
|
||||
|
||||
var topic = commandContext.createTopic(this._model, !this._animated);
|
||||
|
||||
// Connect to topic ...
|
||||
if (this._parentId)
|
||||
{
|
||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
||||
commandContext.connect(topic, parentTopic);
|
||||
commandContext.connect(topic, parentTopic, !this._animated);
|
||||
}
|
||||
|
||||
// Finally, focus ...
|
||||
topic.setOnFocus(true);
|
||||
var doneFn = function(){
|
||||
// Finally, focus ...
|
||||
topic.setOnFocus(true);
|
||||
};
|
||||
|
||||
if(this._animated){
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()],true,doneFn);
|
||||
} else
|
||||
doneFn.attempt();
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
// Finally, delete the topic from the workspace ...
|
||||
var topicId = this._model.getId();
|
||||
var topic = commandContext.findTopics(topicId)[0];
|
||||
commandContext.deleteTopic(topic);
|
||||
var doneFn = function(){
|
||||
commandContext.deleteTopic(topic);
|
||||
};
|
||||
if(this._animated){
|
||||
core.Utils.setVisibilityAnimated([topic,topic.getOutgoingLine()],false, doneFn);
|
||||
}
|
||||
else
|
||||
doneFn.attempt();
|
||||
}
|
||||
});
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.ChangeIconFromTopicCommand = mindplot.Command.extend(
|
||||
@@ -24,13 +23,13 @@ mindplot.commands.ChangeIconFromTopicCommand = mindplot.Command.extend(
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
core.assert(iconId, 'iconId can not be null');
|
||||
core.assert(iconType, 'iconType can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._iconModel = iconId;
|
||||
this._iconType = iconType;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeIcon(this._iconModel);
|
||||
topic.updateNode();
|
||||
@@ -39,7 +38,7 @@ mindplot.commands.ChangeIconFromTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addIcon(this._iconModel, commandContext._designer);
|
||||
topic.updateNode();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.DeleteTopicCommand = mindplot.Command.extend(
|
||||
@@ -22,18 +21,29 @@ mindplot.commands.DeleteTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicsIds)
|
||||
{
|
||||
core.assert(topicsIds, "topicsIds must be defined");
|
||||
this._topicId = topicsIds;
|
||||
this._selectedObjectsIds = topicsIds;
|
||||
this._deletedTopicModels = [];
|
||||
this._parentTopicIds = [];
|
||||
this._deletedRelationships = [];
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topics = commandContext.findTopics(this._topicId);
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds.nodes);
|
||||
if(topics.length>0){
|
||||
topics.forEach(
|
||||
function(topic, index)
|
||||
{
|
||||
var model = topic.getModel().clone();
|
||||
|
||||
//delete relationships
|
||||
var relationships = topic.getRelationships();
|
||||
while(relationships.length>0){
|
||||
var relationship = relationships[0];
|
||||
this._deletedRelationships.push(relationship.getModel().clone());
|
||||
commandContext.removeRelationship(relationship.getModel());
|
||||
}
|
||||
|
||||
this._deletedTopicModels.push(model);
|
||||
|
||||
// Is connected?.
|
||||
@@ -49,12 +59,21 @@ mindplot.commands.DeleteTopicCommand = mindplot.Command.extend(
|
||||
commandContext.deleteTopic(topic);
|
||||
|
||||
}.bind(this)
|
||||
)
|
||||
); }
|
||||
var lines = commandContext.findRelationships(this._selectedObjectsIds.relationshipLines);
|
||||
if(lines.length>0){
|
||||
lines.forEach(function(line,index){
|
||||
if(line.isInWorkspace()){
|
||||
this._deletedRelationships.push(line.getModel().clone());
|
||||
commandContext.removeRelationship(line.getModel());
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
|
||||
var topics = commandContext.findTopics(this._topicId);
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
var parent = commandContext.findTopics(this._parentTopicIds);
|
||||
|
||||
this._deletedTopicModels.forEach(
|
||||
@@ -70,9 +89,14 @@ mindplot.commands.DeleteTopicCommand = mindplot.Command.extend(
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
)
|
||||
);
|
||||
this._deletedRelationships.forEach(
|
||||
function(relationship, index){
|
||||
commandContext.createRelationship(relationship);
|
||||
}.bind(this));
|
||||
|
||||
this._deletedTopicModels = [];
|
||||
this._parentTopicIds = [];
|
||||
this._deletedRelationships = [];
|
||||
}
|
||||
});
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = mindplot.Command.extend(
|
||||
@@ -22,7 +21,7 @@ mindplot.commands.DragTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicId)
|
||||
{
|
||||
core.assert(topicId, "topicId must be defined");
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._parentTopic = null;
|
||||
this._position = null;
|
||||
this._order = null;
|
||||
@@ -31,7 +30,7 @@ mindplot.commands.DragTopicCommand = mindplot.Command.extend(
|
||||
execute: function(commandContext)
|
||||
{
|
||||
|
||||
var topic = commandContext.findTopics([this._topicId])[0];
|
||||
var topic = commandContext.findTopics([this._selectedObjectsIds])[0];
|
||||
|
||||
// Save old position ...
|
||||
var origParentTopic = topic.getOutgoingConnectedTopic();
|
||||
@@ -87,6 +86,10 @@ mindplot.commands.DragTopicCommand = mindplot.Command.extend(
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
this.execute(commandContext);
|
||||
var selectedRelationships = commandContext.getSelectedRelationshipLines();
|
||||
selectedRelationships.forEach(function(relationshipLine,index){
|
||||
relationshipLine.redraw();
|
||||
});
|
||||
|
||||
},
|
||||
setPosition: function(point)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 = mindplot.Command.extend(
|
||||
@@ -24,7 +23,7 @@ mindplot.commands.GenericFunctionCommand = mindplot.Command.extend(
|
||||
core.assert(commandFunc, "commandFunc must be defined");
|
||||
core.assert(topicsIds, "topicsIds must be defined");
|
||||
this._value = value;
|
||||
this._topicId = topicsIds;
|
||||
this._selectedObjectsIds = topicsIds;
|
||||
this._commandFunc = commandFunc;
|
||||
this._oldValues = [];
|
||||
this._id = mindplot.Command._nextUUID();
|
||||
@@ -33,7 +32,7 @@ mindplot.commands.GenericFunctionCommand = mindplot.Command.extend(
|
||||
{
|
||||
if (!this.applied)
|
||||
{
|
||||
var topics = commandContext.findTopics(this._topicId);
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
topics.forEach(function(topic)
|
||||
{
|
||||
var oldValue = this._commandFunc(topic, this._value);
|
||||
@@ -50,7 +49,7 @@ mindplot.commands.GenericFunctionCommand = mindplot.Command.extend(
|
||||
{
|
||||
if (this.applied)
|
||||
{
|
||||
var topics = commandContext.findTopics(this._topicId);
|
||||
var topics = commandContext.findTopics(this._selectedObjectsIds);
|
||||
topics.forEach(function(topic,index)
|
||||
{
|
||||
this._commandFunc(topic, this._oldValues[index]);
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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.commands.MoveControlPointCommand = mindplot.Command.extend(
|
||||
{
|
||||
initialize: function(ctrlPointController, point)
|
||||
{
|
||||
core.assert(ctrlPointController, 'line can not be null');
|
||||
this._ctrlPointControler = ctrlPointController;
|
||||
this._line = ctrlPointController._line;
|
||||
var model = this._line.getModel();
|
||||
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._id = mindplot.Command._nextUUID();
|
||||
this._point = point;
|
||||
},
|
||||
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._refreshSelectedShape();
|
||||
this._ctrlPointControler.setLine(this._line);
|
||||
}
|
||||
this._line.getLine().updateLine(this._point);
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var line = this._line;
|
||||
var model = line.getModel();
|
||||
switch (this._point){
|
||||
case 0:
|
||||
if(core.Utils.isDefined(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(core.Utils.isDefined(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._refreshSelectedShape();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.RemoveIconFromTopicCommand = mindplot.Command.extend(
|
||||
@@ -23,12 +22,12 @@ mindplot.commands.RemoveIconFromTopicCommand = mindplot.Command.extend(
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
core.assert(iconModel, 'iconId can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
this._iconModel = iconModel;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.removeIcon(this._iconModel);
|
||||
topic.updateNode();
|
||||
@@ -37,7 +36,7 @@ mindplot.commands.RemoveIconFromTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
var iconType = this._iconModel.getIconType();
|
||||
var iconImg = topic.addIcon(iconType, commandContext._designer);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.RemoveLinkFromTopicCommand = mindplot.Command.extend(
|
||||
@@ -22,11 +21,11 @@ mindplot.commands.RemoveLinkFromTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicId)
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
this._url = topic._link.getUrl();
|
||||
var updated = function() {
|
||||
topic.removeLink();
|
||||
@@ -35,7 +34,7 @@ mindplot.commands.RemoveLinkFromTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addLink(this._url,commandContext._designer);
|
||||
topic.updateNode();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.RemoveNoteFromTopicCommand = mindplot.Command.extend(
|
||||
@@ -22,11 +21,11 @@ mindplot.commands.RemoveNoteFromTopicCommand = mindplot.Command.extend(
|
||||
initialize: function(topicId)
|
||||
{
|
||||
core.assert(topicId, 'topicId can not be null');
|
||||
this._topicId = topicId;
|
||||
this._selectedObjectsIds = topicId;
|
||||
},
|
||||
execute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
this._text = topic._note.getText();
|
||||
var updated = function() {
|
||||
topic.removeNote();
|
||||
@@ -35,7 +34,7 @@ mindplot.commands.RemoveNoteFromTopicCommand = mindplot.Command.extend(
|
||||
},
|
||||
undoExecute: function(commandContext)
|
||||
{
|
||||
var topic = commandContext.findTopics(this._topicId)[0];
|
||||
var topic = commandContext.findTopics(this._selectedObjectsIds)[0];
|
||||
var updated = function() {
|
||||
topic.addNote(this._text,commandContext._designer);
|
||||
topic.updateNode();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
if(afterMindpotLibraryLoading)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
// (C) Copyright 2007 WiseMapping.com. All Rights Reserved
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.util.Shape =
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
<include>${basedir}/target/tmp/peer/svg/Font-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/ArialFont-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/PolyLinePeer-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/CurvedLinePeer-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/ArrowPeer-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/TextPeer-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/WorkspacePeer-min.js</include>
|
||||
<include>${basedir}/target/tmp/peer/svg/GroupPeer-min.js</include>
|
||||
@@ -109,6 +111,8 @@
|
||||
<include>${basedir}/target/tmp/Image-min.js</include>
|
||||
<include>${basedir}/target/tmp/Line-min.js</include>
|
||||
<include>${basedir}/target/tmp/PolyLine-min.js</include>
|
||||
<include>${basedir}/target/tmp/CurvedLine-min.js</include>
|
||||
<include>${basedir}/target/tmp/Arrow-min.js</include>
|
||||
<include>${basedir}/target/tmp/Rect-min.js</include>
|
||||
<include>${basedir}/target/tmp/Text-min.js</include>
|
||||
<include>${basedir}/target/tmp/Toolkit-min.js</include>
|
||||
|
||||
64
web2d/src/main/javascript/Arrow.js
Normal file
64
web2d/src/main/javascript/Arrow.js
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
web2d.Arrow = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createArrow();
|
||||
var defaultAttributes = {strokeColor:'black',strokeWidth:1,strokeStyle:'solid',strokeOpacity:1};
|
||||
for (var key in attributes)
|
||||
{
|
||||
defaultAttributes[key] = attributes[key];
|
||||
}
|
||||
web2d.Element.call(this, peer, defaultAttributes);
|
||||
};
|
||||
objects.extend(web2d.Arrow, web2d.Element);
|
||||
|
||||
web2d.Arrow.prototype.getType = function()
|
||||
{
|
||||
return "Arrow";
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.setFrom = function(x,y)
|
||||
{
|
||||
this._peer.setFrom(x,y);
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.setControlPoint = function (point)
|
||||
{
|
||||
this._peer.setControlPoint(point);
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.setStrokeColor = function (color)
|
||||
{
|
||||
this._peer.setStrokeColor(color);
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.setStrokeWidth = function(width)
|
||||
{
|
||||
this._peer.setStrokeWidth(width);
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.setDashed = function(isDashed, length, spacing){
|
||||
this._peer.setDashed(isDashed, length, spacing);
|
||||
};
|
||||
|
||||
web2d.Arrow.prototype.reDraw = function()
|
||||
{
|
||||
this._peer._redraw();
|
||||
};
|
||||
119
web2d/src/main/javascript/CurvedLine.js
Normal file
119
web2d/src/main/javascript/CurvedLine.js
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.CurvedLine = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createCurvedLine();
|
||||
var defaultAttributes = {strokeColor:'blue',strokeWidth:1,strokeStyle:'solid',strokeOpacity:1};
|
||||
for (var key in attributes)
|
||||
{
|
||||
defaultAttributes[key] = attributes[key];
|
||||
}
|
||||
web2d.Element.call(this, peer, defaultAttributes);
|
||||
};
|
||||
objects.extend(web2d.CurvedLine, web2d.Element);
|
||||
|
||||
web2d.CurvedLine.prototype.getType = function()
|
||||
{
|
||||
return "CurvedLine";
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setFrom = function(x, y)
|
||||
{
|
||||
this._peer.setFrom(x, y);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setTo = function(x, y)
|
||||
{
|
||||
this._peer.setTo(x, y);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.getFrom = function()
|
||||
{
|
||||
return this._peer.getFrom();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.getTo = function()
|
||||
{
|
||||
return this._peer.getTo();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setShowEndArrow = function(visible){
|
||||
this._peer.setShowEndArrow(visible);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.isShowEndArrow = function(){
|
||||
return this._peer.isShowEndArrow();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setShowStartArrow = function(visible){
|
||||
this._peer.setShowStartArrow(visible);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.isShowStartArrow = function(){
|
||||
return this._peer.isShowStartArrow();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setSrcControlPoint = function(control){
|
||||
this._peer.setSrcControlPoint(control);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setDestControlPoint = function(control){
|
||||
this._peer.setDestControlPoint(control);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.getControlPoints = function(){
|
||||
return this._peer.getControlPoints();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.isSrcControlPointCustom = function(){
|
||||
return this._peer.isSrcControlPointCustom();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.isDestControlPointCustom = function(){
|
||||
return this._peer.isDestControlPointCustom();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setIsSrcControlPointCustom = function(isCustom){
|
||||
this._peer.setIsSrcControlPointCustom(isCustom);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setIsDestControlPointCustom = function(isCustom){
|
||||
this._peer.setIsDestControlPointCustom(isCustom);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.updateLine= function(avoidControlPointFix){
|
||||
return this._peer.updateLine(avoidControlPointFix);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setStyle = function(style){
|
||||
this._peer.setLineStyle(style);
|
||||
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.getStyle = function(){
|
||||
return this._peer.getLineStyle();
|
||||
};
|
||||
|
||||
web2d.CurvedLine.prototype.setDashed = function(length,spacing){
|
||||
this._peer.setDashed(length, spacing);
|
||||
};
|
||||
|
||||
web2d.CurvedLine.SIMPLE_LINE = false;
|
||||
web2d.CurvedLine.NICE_LINE = true;
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Element = function(peer, attributes)
|
||||
{
|
||||
this._peer = peer;
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Elipse = function(attributes)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.EventDispatcher = function(element)
|
||||
{
|
||||
this._listeners = [];
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Font = function(fontFamily, textPeer)
|
||||
{
|
||||
var font = "web2d.peer.Toolkit.create" + fontFamily + "Font();";
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A group object can be used to collect shapes.
|
||||
*/
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Image = function(attributes)
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Line = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createLine();
|
||||
@@ -44,6 +43,16 @@ web2d.Line.prototype.setTo = function(x, y)
|
||||
this._peer.setTo(x, y);
|
||||
};
|
||||
|
||||
web2d.Line.prototype.getFrom = function()
|
||||
{
|
||||
return this._peer.getFrom();
|
||||
};
|
||||
|
||||
web2d.Line.prototype.getTo = function()
|
||||
{
|
||||
return this._peer.getTo();
|
||||
};
|
||||
|
||||
/**
|
||||
* Defines the start and the end line arrow style.
|
||||
* Can have values "none | block | classic | diamond | oval | open | chevron | doublechevron"
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.PolyLine = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createPolyLine();
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create a rectangle and variations of a rectangle shape.
|
||||
* arc must be specified to create rounded rectangles.
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Text = function(attributes)
|
||||
{
|
||||
var peer = web2d.peer.Toolkit.createText();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.peer.ToolkitVML =
|
||||
@@ -74,9 +73,11 @@ web2d.peer.ToolkitVML =
|
||||
{
|
||||
return new web2d.peer.vml.LinePeer();
|
||||
},
|
||||
createPolyLine: function()
|
||||
createCurvedLine: function()
|
||||
{
|
||||
},
|
||||
createArrow: function()
|
||||
{
|
||||
return new web2d.peer.vml.PolyLinePeer();
|
||||
},
|
||||
createImage: function ()
|
||||
{
|
||||
@@ -135,6 +136,14 @@ web2d.peer.ToolkitSVG =
|
||||
{
|
||||
return new web2d.peer.svg.PolyLinePeer();
|
||||
},
|
||||
createCurvedLine: function()
|
||||
{
|
||||
return new web2d.peer.svg.CurvedLinePeer();
|
||||
},
|
||||
createArrow: function()
|
||||
{
|
||||
return new web2d.peer.svg.ArrowPeer();
|
||||
},
|
||||
createText: function ()
|
||||
{
|
||||
return new web2d.peer.svg.TextPeer();
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.Workspace = function(attributes)
|
||||
{
|
||||
this._htmlContainer = this._createDivContainer();
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* Copyright [2011] [wisemapping]
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
* http://www.wisemapping.org/license
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
* 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 web2d = {};
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.peer.svg.ArialFont = function()
|
||||
{
|
||||
web2d.peer.svg.Font.call(this);
|
||||
|
||||
99
web2d/src/main/javascript/peer/svg/ArrowPeer.js
Normal file
99
web2d/src/main/javascript/peer/svg/ArrowPeer.js
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.peer.svg.ArrowPeer = function()
|
||||
{
|
||||
var svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
||||
web2d.peer.svg.ElementPeer.call(this, svgElement);
|
||||
this._style={};
|
||||
this._controlPoint=new core.Point();
|
||||
this._fromPoint = new core.Point();
|
||||
};
|
||||
|
||||
objects.extend(web2d.peer.svg.ArrowPeer, web2d.peer.svg.ElementPeer);
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype.setFrom = function(x,y)
|
||||
{
|
||||
this._fromPoint.x = x;
|
||||
this._fromPoint.y = y;
|
||||
this._redraw();
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype.setControlPoint = function (point)
|
||||
{
|
||||
this._controlPoint = point;
|
||||
this._redraw();
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype.setStrokeColor = function (color)
|
||||
{
|
||||
this.setStroke(null,null,color, null);
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype.setStrokeWidth = function(width)
|
||||
{
|
||||
this.setStroke(width);
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype.setDashed = function(isDashed, length, spacing){
|
||||
if(core.Utils.isDefined(isDashed) && isDashed && core.Utils.isDefined(length) && core.Utils.isDefined(spacing)){
|
||||
this._native.setAttribute("stroke-dasharray",length+","+spacing);
|
||||
} else {
|
||||
this._native.setAttribute("stroke-dasharray","");
|
||||
}
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype._updateStyle = function()
|
||||
{
|
||||
var style = "";
|
||||
for(var key in this._style){
|
||||
style+=key+":"+this._style[key]+" ";
|
||||
}
|
||||
this._native.setAttribute("style",style);
|
||||
};
|
||||
|
||||
web2d.peer.svg.ArrowPeer.prototype._redraw = function()
|
||||
{
|
||||
var x,y, xp, yp;
|
||||
if(this._controlPoint.y == 0)
|
||||
this._controlPoint.y=1;
|
||||
var y0 = this._controlPoint.y;
|
||||
var x0 = this._controlPoint.x;
|
||||
var x2=x0+y0;
|
||||
var y2 = y0-x0;
|
||||
var x3 = x0-y0;
|
||||
var y3 = y0+x0;
|
||||
var m = y2/x2;
|
||||
var mp = y3/x3;
|
||||
var l = 6;
|
||||
var pow = Math.pow;
|
||||
x = (x2==0?0:Math.sqrt(pow(l,2)/(1+pow(m,2))));
|
||||
x *=Math.sign(x2);
|
||||
y = (x2==0?l*Math.sign(y2):m*x);
|
||||
xp = (x3==0?0:Math.sqrt(pow(l,2)/(1+pow(mp,2))));
|
||||
xp *=Math.sign(x3);
|
||||
yp = (x3==0?l*Math.sign(y3):mp*xp);
|
||||
|
||||
var path = "M"+this._fromPoint.x+","+this._fromPoint.y+" "
|
||||
+"L"+(x+this._fromPoint.x)+","+(y+this._fromPoint.y)
|
||||
+"M"+this._fromPoint.x+","+this._fromPoint.y+" "
|
||||
+"L"+(xp+this._fromPoint.x)+","+(yp+this._fromPoint.y)
|
||||
;
|
||||
this._native.setAttribute("d",path);
|
||||
};
|
||||
|
||||
200
web2d/src/main/javascript/peer/svg/CurvedLinePeer.js
Normal file
200
web2d/src/main/javascript/peer/svg/CurvedLinePeer.js
Normal file
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer = function()
|
||||
{
|
||||
var svgElement = window.document.createElementNS(this.svgNamespace, 'path');
|
||||
web2d.peer.svg.ElementPeer.call(this, svgElement);
|
||||
this._style={fill:'gray'};
|
||||
this._updateStyle();
|
||||
this._customControlPoint_1 = false;
|
||||
this._customControlPoint_2 = false;
|
||||
this._control1=new core.Point();
|
||||
this._control2=new core.Point();
|
||||
this._lineStyle=true;
|
||||
};
|
||||
|
||||
objects.extend(web2d.peer.svg.CurvedLinePeer, web2d.peer.svg.ElementPeer);
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setSrcControlPoint = function(control){
|
||||
this._customControlPoint_1 = true;
|
||||
if(core.Utils.isDefined(control.x)){
|
||||
this._control1 = control;
|
||||
this._control1.x = parseInt(this._control1.x);
|
||||
this._control1.y = parseInt(this._control1.y)
|
||||
}
|
||||
this._updatePath();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setDestControlPoint = function(control){
|
||||
this._customControlPoint_2 = true;
|
||||
if(core.Utils.isDefined(control.x)){
|
||||
this._control2 = control;
|
||||
this._control2.x = parseInt(this._control2.x);
|
||||
this._control2.y = parseInt(this._control2.y)
|
||||
}
|
||||
this._updatePath();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.isSrcControlPointCustom = function() {
|
||||
return this._customControlPoint_1;
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.isDestControlPointCustom = function() {
|
||||
return this._customControlPoint_2;
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setIsSrcControlPointCustom = function(isCustom) {
|
||||
this._customControlPoint_1 = isCustom;
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setIsDestControlPointCustom = function(isCustom) {
|
||||
this._customControlPoint_2 = isCustom;
|
||||
};
|
||||
|
||||
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.getControlPoints = function(){
|
||||
return [this._control1, this._control2];
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setFrom = function(x1, y1)
|
||||
{
|
||||
this._x1 = parseInt(x1);
|
||||
this._y1 = parseInt(y1);
|
||||
this._updatePath();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setTo = function(x2, y2)
|
||||
{
|
||||
this._x2 = parseInt(x2);
|
||||
this._y2 = parseInt(y2);
|
||||
this._updatePath();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.getFrom = function()
|
||||
{
|
||||
return new core.Point(this._x1,this._y1);
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.getTo = function()
|
||||
{
|
||||
return new core.Point(this._x2,this._y2);
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setStrokeWidth = function(width)
|
||||
{
|
||||
this._style['stroke-width']= width;
|
||||
this._updateStyle();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setColor = function(color)
|
||||
{
|
||||
this._style['stroke']= color;
|
||||
this._style['fill']=color;
|
||||
this._updateStyle();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.updateLine = function(avoidControlPointFix){
|
||||
this._updatePath(avoidControlPointFix);
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setLineStyle = function (style){
|
||||
this._lineStyle=style;
|
||||
if(this._lineStyle){
|
||||
this._style['fill']=this._fill;
|
||||
} else {
|
||||
this._fill = this._style['fill'];
|
||||
this._style['fill']='none';
|
||||
}
|
||||
this._updateStyle();
|
||||
this.updateLine();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.getLineStyle = function (){
|
||||
return this._lineStyle;
|
||||
};
|
||||
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setShowEndArrow = function(visible){
|
||||
this._showEndArrow =visible;
|
||||
this.updateLine();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.isShowEndArrow = function(){
|
||||
return this._showEndArrow;
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setShowStartArrow = function(visible){
|
||||
this._showStartArrow =visible;
|
||||
this.updateLine();
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.isShowStartArrow = function(){
|
||||
return this._showStartArrow;
|
||||
};
|
||||
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype._updatePath = function(avoidControlPointFix)
|
||||
{
|
||||
this._calculateAutoControlPoints(avoidControlPointFix);
|
||||
var path = "M"+this._x1+","+this._y1
|
||||
+" C"+(this._control1.x+this._x1)+","+(this._control1.y+this._y1)+" "
|
||||
+(this._control2.x+this._x2)+","+(this._control2.y+this._y2)+" "
|
||||
+this._x2+","+this._y2+
|
||||
(this._lineStyle?" "
|
||||
+(this._control2.x+this._x2)+","+(this._control2.y+this._y2+3)+" "
|
||||
+(this._control1.x+this._x1)+","+(this._control1.y+this._y1+3)+" "
|
||||
+this._x1+","+(this._y1+3)+" Z"
|
||||
:""
|
||||
);
|
||||
this._native.setAttribute("d",path);
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype._updateStyle = function()
|
||||
{
|
||||
var style = "";
|
||||
for(var key in this._style){
|
||||
style+=key+":"+this._style[key]+" ";
|
||||
}
|
||||
this._native.setAttribute("style",style);
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype._calculateAutoControlPoints = function(avoidControlPointFix){
|
||||
if(core.Utils.isDefined(this._x1) && core.Utils.isDefined(this._x2)){
|
||||
//Both points available, calculate real points
|
||||
var defaultpoints = core.Utils.calculateDefaultControlPoints(new core.Point(this._x1, this._y1),new core.Point(this._x2,this._y2));
|
||||
if(!this._customControlPoint_1 && !(core.Utils.isDefined(avoidControlPointFix) && avoidControlPointFix==0)){
|
||||
this._control1.x = defaultpoints[0].x;
|
||||
this._control1.y = defaultpoints[0].y;
|
||||
}
|
||||
if(!this._customControlPoint_2 && !(core.Utils.isDefined(avoidControlPointFix) && avoidControlPointFix==1)){
|
||||
this._control2.x = defaultpoints[1].x;
|
||||
this._control2.y = defaultpoints[1].y;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
web2d.peer.svg.CurvedLinePeer.prototype.setDashed = function(length,spacing){
|
||||
if(core.Utils.isDefined(length) && core.Utils.isDefined(spacing)){
|
||||
this._native.setAttribute("stroke-dasharray",length+","+spacing);
|
||||
} else {
|
||||
this._native.setAttribute("stroke-dasharray","");
|
||||
}
|
||||
|
||||
};
|
||||
@@ -1,22 +1,21 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* $Id: file 64488 2006-03-10 17:32:09Z paulo $
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
web2d.peer.svg.ElementPeer = function(svgElement)
|
||||
{
|
||||
this._native = svgElement;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user