Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an 'AS IS' BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Sean Condon | 0d064ec | 2019-02-04 21:53:53 +0000 | [diff] [blame^] | 16 | import {Component, Input, OnInit} from '@angular/core'; |
| 17 | import {MapObject} from '../maputils'; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 18 | |
| 19 | /** |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 20 | * model of the topo2CurrentLayout attrs from BgZoom below |
| 21 | */ |
| 22 | export interface BgZoomAttrs { |
| 23 | offsetX: number; |
| 24 | offsetY: number; |
| 25 | scale: number; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * model of the topo2CurrentLayout background zoom attrs from Layout below |
| 30 | */ |
| 31 | export interface BgZoom { |
| 32 | cfg: BgZoomAttrs; |
| 33 | usr?: BgZoomAttrs; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * model of the topo2CurrentLayout breadcrumb from Layout below |
| 38 | */ |
| 39 | export interface LayoutCrumb { |
| 40 | id: string; |
| 41 | name: string; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Enum of the topo2CurrentRegion location type from Location below |
| 46 | */ |
| 47 | export enum LocationType { |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 48 | NONE = 'none', |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 49 | GEO = 'geo', |
| 50 | GRID = 'grid' |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * model of the topo2CurrentLayout WebSocket response |
| 55 | */ |
| 56 | export interface Layout { |
| 57 | id: string; |
| 58 | bgDefaultScale: number; |
| 59 | bgDesc: string; |
| 60 | bgFilePath: string; |
| 61 | bgId: string; |
| 62 | bgType: LocationType; |
| 63 | bgWarn: string; |
| 64 | bgZoom: BgZoom; |
| 65 | crumbs: LayoutCrumb[]; |
| 66 | parent: string; |
| 67 | region: string; |
| 68 | regionName: string; |
| 69 | } |
| 70 | |
| 71 | /** |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 72 | * ONOS GUI -- Topology Background Layer View. |
| 73 | */ |
| 74 | @Component({ |
| 75 | selector: '[onos-backgroundsvg]', |
| 76 | templateUrl: './backgroundsvg.component.html', |
| 77 | styleUrls: ['./backgroundsvg.component.css'] |
| 78 | }) |
| 79 | export class BackgroundSvgComponent implements OnInit { |
Sean Condon | 0d064ec | 2019-02-04 21:53:53 +0000 | [diff] [blame^] | 80 | @Input() map: MapObject; |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 81 | |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 82 | layoutData: Layout = <Layout>{}; |
| 83 | |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 84 | constructor() { } |
| 85 | |
| 86 | ngOnInit() { |
| 87 | } |
| 88 | |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 89 | |
| 90 | |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 91 | } |