X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fotf.git;a=blobdiff_plain;f=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Fmodeler%2Fcustom-elements%2Flog-test-result%2Fdraw%2FLogTestResultRenderer.js;fp=otf-frontend%2Fclient%2Fsrc%2Fapp%2Flayout%2Fmodeler%2Fcustom-elements%2Flog-test-result%2Fdraw%2FLogTestResultRenderer.js;h=607cd08086022296f0d78bf04cfba0023917bb01;hp=0000000000000000000000000000000000000000;hb=14f6f95c84a4a1fa8774190db4a03fd0214ec55f;hpb=f49bd1efeaaddd4891c1f329b18d8cfb28b3e75b diff --git a/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js new file mode 100644 index 0000000..607cd08 --- /dev/null +++ b/otf-frontend/client/src/app/layout/modeler/custom-elements/log-test-result/draw/LogTestResultRenderer.js @@ -0,0 +1,60 @@ +/* Copyright (c) 2019 AT&T Intellectual Property. # +# # +# 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. # +##############################################################################*/ + + +import inherits from 'inherits'; + +import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'; + +import { + is +} from 'bpmn-js/lib/util/ModelUtil'; + +import Cat from '../image'; + +import { + append as svgAppend, + create as svgCreate +} from 'tiny-svg'; + + +export default function NyanRender(eventBus) { + BaseRenderer.call(this, eventBus, 1500); + + this.canRender = function(element) { + return is(element, 'custom:Log'); + }; + + + this.drawShape = function(parent, shape) { + var url = Cat.dataURL; + + var catGfx = svgCreate('image', { + x: 0, + y: 0, + width: shape.width, + height: shape.height, + href: url + }); + + svgAppend(parent, catGfx); + + return catGfx; + }; +} + +inherits(NyanRender, BaseRenderer); + +NyanRender.$inject = [ 'eventBus' ]; \ No newline at end of file