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 | */ |
| 16 | import { Component, OnInit } from '@angular/core'; |
| 17 | |
| 18 | /** |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 19 | * model of the topo2CurrentLayout attrs from BgZoom below |
| 20 | */ |
| 21 | export interface BgZoomAttrs { |
| 22 | offsetX: number; |
| 23 | offsetY: number; |
| 24 | scale: number; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * model of the topo2CurrentLayout background zoom attrs from Layout below |
| 29 | */ |
| 30 | export interface BgZoom { |
| 31 | cfg: BgZoomAttrs; |
| 32 | usr?: BgZoomAttrs; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * model of the topo2CurrentLayout breadcrumb from Layout below |
| 37 | */ |
| 38 | export interface LayoutCrumb { |
| 39 | id: string; |
| 40 | name: string; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Enum of the topo2CurrentRegion location type from Location below |
| 45 | */ |
| 46 | export enum LocationType { |
Sean Condon | 0c577f6 | 2018-11-18 22:40:05 +0000 | [diff] [blame] | 47 | NONE = 'none', |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 48 | GEO = 'geo', |
| 49 | GRID = 'grid' |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * model of the topo2CurrentLayout WebSocket response |
| 54 | */ |
| 55 | export interface Layout { |
| 56 | id: string; |
| 57 | bgDefaultScale: number; |
| 58 | bgDesc: string; |
| 59 | bgFilePath: string; |
| 60 | bgId: string; |
| 61 | bgType: LocationType; |
| 62 | bgWarn: string; |
| 63 | bgZoom: BgZoom; |
| 64 | crumbs: LayoutCrumb[]; |
| 65 | parent: string; |
| 66 | region: string; |
| 67 | regionName: string; |
| 68 | } |
| 69 | |
| 70 | /** |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 71 | * ONOS GUI -- Topology Background Layer View. |
| 72 | */ |
| 73 | @Component({ |
| 74 | selector: '[onos-backgroundsvg]', |
| 75 | templateUrl: './backgroundsvg.component.html', |
| 76 | styleUrls: ['./backgroundsvg.component.css'] |
| 77 | }) |
| 78 | export class BackgroundSvgComponent implements OnInit { |
| 79 | |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 80 | layoutData: Layout = <Layout>{}; |
| 81 | |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 82 | constructor() { } |
| 83 | |
| 84 | ngOnInit() { |
| 85 | } |
| 86 | |
Sean Condon | aa4366d | 2018-11-02 14:29:01 +0000 | [diff] [blame] | 87 | |
| 88 | |
Sean Condon | f4f54a1 | 2018-10-10 23:25:46 +0100 | [diff] [blame] | 89 | } |