Change to typescript

This commit is contained in:
Paulo Gustavo Veiga 2022-03-13 23:45:28 -03:00
parent 5ad8d94ac8
commit be638eb7ed
3 changed files with 7 additions and 14 deletions

View File

@ -707,10 +707,11 @@ abstract class Topic extends NodeGraph {
// Do some fancy animation .... // Do some fancy animation ....
const elements = this._flatten2DElements(this); const elements = this._flatten2DElements(this);
elements.forEach((elem) => { elements.forEach((elem) => {
elem.setVisibility(!value, 250); elem.setVisibility(!value, 250)
}); });
EventBus.instance.fireEvent('childShrinked', model); EventBus.instance.fireEvent('childShrinked', model);
} }
getShrinkConnector(): ShirinkConnector | undefined { getShrinkConnector(): ShirinkConnector | undefined {
@ -902,6 +903,7 @@ abstract class Topic extends NodeGraph {
current.setVisibility(value); current.setVisibility(value);
} }
/** */
setVisibility(value: boolean, fade = 0): void { setVisibility(value: boolean, fade = 0): void {
this._setTopicVisibility(value, fade); this._setTopicVisibility(value, fade);
@ -958,9 +960,8 @@ abstract class Topic extends NodeGraph {
relationship.setVisibility( relationship.setVisibility(
value value
&& (targetParent == null || !targetParent.areChildrenShrunken()) && (targetParent == null || !targetParent.areChildrenShrunken())
&& (sourceParent == null || !sourceParent.areChildrenShrunken()), && (sourceParent == null || !sourceParent.areChildrenShrunken())
fade, , fade);
);
}); });
} }

View File

@ -40,14 +40,6 @@ const TopicFeatureFactory = {
icon: NoteIcon, icon: NoteIcon,
}, },
/**
* @param {mindplot.Topic} topic
* @param {mindplot.model.FeatureModel} model
* @param {Boolean} readOnly true if the editor is running in read-only mode
* @throws will throw an error if topic is null or undefined
* @throws will throw v an error if model is null or undefined
* @return {mindplot.n,nmn mn4 r be5qnwwddwsz5on} a new instance of the icon subclass matching the topic feature
*/
createIcon(topic, model, readOnly) { createIcon(topic, model, readOnly) {
$assert(topic, 'topic can not be null'); $assert(topic, 'topic can not be null');
$assert(model, 'model can not be null'); $assert(model, 'model can not be null');

View File

@ -15,9 +15,9 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import RootedTreeSet from './RootedTreeSet'; import RootedTreeSet from "./RootedTreeSet";
import Node from './Node'; import Node from './Node';
import PositionType from '../PositionType'; import PositionType from "../PositionType";
abstract class ChildrenSorterStrategy { abstract class ChildrenSorterStrategy {
abstract computeChildrenIdByHeights(treeSet: RootedTreeSet, node: Node); abstract computeChildrenIdByHeights(treeSet: RootedTreeSet, node: Node);