changed the header and license
[aai/sparky-fe.git] / src / generic-components / graph / Link.jsx
1 /*
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * Copyright © 2017-2018 Amdocs
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *       http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 import React, {Component} from 'react';
22
23 import TempCreateAttributes from './TempCreateAttributes.js';
24
25 class Link extends Component {
26                 
27                 static propTypes = {
28                                 x1: React.PropTypes.number,
29                                 y1: React.PropTypes.number,
30                                 x2: React.PropTypes.number,
31                                 y2: React.PropTypes.number,
32                                 linkAttributes: React.PropTypes.object
33                 };
34                 
35                 static defaultProps = {
36                                 x1: 0,
37                                 y1: 0,
38                                 x2: 0,
39                                 y2: 0,
40                                 linkAttributes: {}
41                 };
42                 
43                 render() {
44                                 let {x1, y1, x2, y2, linkAttributes} = this.props;
45                                 
46                                 let combinedAttributes = {
47                                                 ...linkAttributes,
48                                                 x1: x1,
49                                                 y1: y1,
50                                                 x2: x2,
51                                                 y2: y2
52                                 };
53                                 
54                                 return (
55                                                 <line {...combinedAttributes}
56                                                                 style={TempCreateAttributes.createLineStyle()}/>
57                                 );
58                 }
59 }
60
61 export default Link;