Simon Hunt | f679c4e | 2016-04-01 17:02:24 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Simon Hunt | f679c4e | 2016-04-01 17:02:24 -0700 | [diff] [blame] | 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 | |
| 17 | package org.onosproject.ui.model.topo; |
| 18 | |
| 19 | import org.onosproject.net.region.Region; |
| 20 | |
| 21 | /** |
| 22 | * Represents a specific "subset" of the UI model of the network topology |
| 23 | * that a user might wish to view. Backed by a {@link Region}. |
| 24 | */ |
| 25 | public class UiTopoLayout { |
| 26 | |
Thomas Vachuska | 4d66d0a | 2016-04-15 15:48:13 -0700 | [diff] [blame] | 27 | private final UiTopoLayoutId id; |
| 28 | private final Region region; |
Simon Hunt | f679c4e | 2016-04-01 17:02:24 -0700 | [diff] [blame] | 29 | |
Thomas Vachuska | 4d66d0a | 2016-04-15 15:48:13 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Created a new UI topology layout. |
| 32 | * |
| 33 | * @param id layout identifier |
| 34 | * @param region backing region |
| 35 | */ |
| 36 | public UiTopoLayout(UiTopoLayoutId id, Region region) { |
| 37 | this.id = id; |
| 38 | this.region = region; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Returns the UI layout identifier. |
| 43 | * |
| 44 | * @return identifier of the layout |
| 45 | */ |
| 46 | public UiTopoLayoutId id() { |
| 47 | return id; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Returns the backing region with which this layout is associated. |
| 52 | * |
| 53 | * @return backing region |
| 54 | */ |
| 55 | public Region region() { |
| 56 | return region; |
| 57 | } |
| 58 | |
| 59 | // TODO: additional properties pertinent to the layout |
Simon Hunt | f679c4e | 2016-04-01 17:02:24 -0700 | [diff] [blame] | 60 | } |