Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -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 | 5f6dbf8 | 2016-03-30 08:53:33 -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 | /** |
| 20 | * Represents a node drawn on the topology view (region, device, host). |
| 21 | */ |
Simon Hunt | 977aa05 | 2016-07-20 17:08:29 -0700 | [diff] [blame] | 22 | public abstract class UiNode extends UiElement { |
Simon Hunt | d5b9673 | 2016-07-08 13:22:27 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * Default "layer" tag. |
| 26 | */ |
| 27 | public static final String LAYER_DEFAULT = "def"; |
| 28 | |
| 29 | /** |
| 30 | * Packet layer tag. |
| 31 | */ |
| 32 | public static final String LAYER_PACKET = "pkt"; |
| 33 | |
| 34 | /** |
| 35 | * Optical layer tag. |
| 36 | */ |
| 37 | public static final String LAYER_OPTICAL = "opt"; |
| 38 | |
| 39 | |
| 40 | private String layer = LAYER_DEFAULT; |
| 41 | |
| 42 | /** |
| 43 | * Returns the tag for the "layer" that the node should be rendered in |
| 44 | * when viewed in the oblique view. |
| 45 | * |
| 46 | * @return the node's layer |
| 47 | */ |
| 48 | public String layer() { |
| 49 | return layer; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Sets this node's "layer", for layered rendering. |
| 54 | * |
| 55 | * @param layerTag the layer tag to set |
| 56 | */ |
| 57 | public void setLayer(String layerTag) { |
| 58 | layer = layerTag; |
| 59 | } |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 60 | } |