2010-12-13 11:07:20 -03:00
|
|
|
/*
|
2011-07-28 14:07:01 -03:00
|
|
|
* 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 = new Class({
|
|
|
|
|
|
|
|
Extends:mindplot.Topic,
|
2011-09-02 02:31:03 -03:00
|
|
|
initialize: function(model, options) {
|
|
|
|
this.parent(model, options);
|
2011-08-15 09:27:31 -03:00
|
|
|
},
|
|
|
|
|
2011-08-19 13:38:37 -03:00
|
|
|
_registerEvents : function() {
|
|
|
|
this.parent();
|
2011-08-15 09:27:31 -03:00
|
|
|
|
2011-08-19 13:38:37 -03:00
|
|
|
// This disable the drag of the central topic. But solves the problem of deselecting the nodes when the screen is clicked.
|
2011-08-21 12:42:00 -03:00
|
|
|
this.addEvent('mousedown', function(event) {
|
2011-08-15 09:27:31 -03:00
|
|
|
event.stopPropagation();
|
|
|
|
});
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
2012-01-21 15:30:39 -03:00
|
|
|
workoutIncomingConnectionPoint : function() {
|
2011-07-28 14:07:01 -03:00
|
|
|
return this.getPosition();
|
|
|
|
},
|
|
|
|
|
2011-09-02 02:31:03 -03:00
|
|
|
_getInnerPadding : function() {
|
2011-09-04 15:26:42 -03:00
|
|
|
return 11;
|
2011-09-02 02:31:03 -03:00
|
|
|
},
|
|
|
|
|
2011-07-28 14:07:01 -03:00
|
|
|
getTopicType : function() {
|
2011-09-08 10:03:42 -03:00
|
|
|
return mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE;
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
setCursor : function(type) {
|
|
|
|
type = (type == 'move') ? 'default' : type;
|
2011-07-30 05:22:57 -03:00
|
|
|
this.parent(type);
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
isConnectedToCentralTopic : function() {
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
|
2009-06-07 18:59:43 +00:00
|
|
|
|
2011-07-28 14:07:01 -03:00
|
|
|
_defaultShapeType : function() {
|
2012-02-27 22:47:10 -03:00
|
|
|
return mindplot.model.TopicShape.ROUNDED_RECT;
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
updateTopicShape : function() {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
_updatePositionOnChangeSize : function(oldSize, newSize, updatePosition) {
|
|
|
|
|
|
|
|
// Center main topic ...
|
|
|
|
var zeroPoint = new core.Point(0, 0);
|
|
|
|
this.setPosition(zeroPoint);
|
|
|
|
},
|
|
|
|
|
|
|
|
_defaultText : function() {
|
|
|
|
return "Central Topic";
|
|
|
|
},
|
|
|
|
|
|
|
|
_defaultBackgroundColor : function() {
|
2011-10-14 22:56:20 -03:00
|
|
|
return "rgb(80,157,192)";
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
_defaultBorderColor : function() {
|
2011-10-14 22:56:20 -03:00
|
|
|
return "rgb(57,113,177)";
|
2011-07-28 14:07:01 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
_defaultFontStyle : function() {
|
|
|
|
return {
|
|
|
|
font:"Verdana",
|
|
|
|
size: 10,
|
|
|
|
style:"normal",
|
|
|
|
weight:"bold",
|
2011-10-14 22:56:20 -03:00
|
|
|
color:"#ffffff"
|
2011-07-28 14:07:01 -03:00
|
|
|
};
|
2012-03-08 00:30:27 -03:00
|
|
|
},
|
|
|
|
|
|
|
|
getShrinkConnector : function() {
|
|
|
|
return null;
|
2009-06-07 18:59:43 +00:00
|
|
|
}
|
2011-07-28 14:07:01 -03:00
|
|
|
});
|