Simon Hunt | fb94011 | 2015-07-29 18:36:35 -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 | fb94011 | 2015-07-29 18:36:35 -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 | |
| 18 | package org.meowster.over; |
| 19 | |
| 20 | import org.onosproject.ui.UiTopoOverlay; |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 21 | import org.onosproject.ui.topo.ButtonId; |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 22 | import org.onosproject.ui.topo.PropertyPanel; |
Simon Hunt | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame] | 23 | import org.onosproject.ui.topo.TopoConstants.CoreButtons; |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 24 | import org.onosproject.ui.topo.TopoConstants.Glyphs; |
| 25 | |
| 26 | import static org.onosproject.ui.topo.TopoConstants.Properties.*; |
| 27 | |
| 28 | /** |
| 29 | * Our topology overlay. |
| 30 | */ |
| 31 | public class AppUiTopoOverlay extends UiTopoOverlay { |
| 32 | |
| 33 | // NOTE: this must match the ID defined in topov.js |
| 34 | private static final String OVERLAY_ID = "meowster-overlay"; |
| 35 | |
| 36 | private static final String MY_TITLE = "I changed the title"; |
| 37 | private static final String MY_VERSION = "Beta-1.0.0042"; |
Simon Hunt | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame] | 38 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 39 | private static final ButtonId FOO_BUTTON = new ButtonId("foo"); |
| 40 | private static final ButtonId BAR_BUTTON = new ButtonId("bar"); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 41 | |
| 42 | public AppUiTopoOverlay() { |
| 43 | super(OVERLAY_ID); |
| 44 | } |
| 45 | |
| 46 | |
| 47 | @Override |
| 48 | public void modifySummary(PropertyPanel pp) { |
| 49 | pp.title("My App Rocks!") |
| 50 | .typeId(Glyphs.CROWN) |
| 51 | .removeProps( |
| 52 | TOPOLOGY_SSCS, |
| 53 | INTENTS, |
| 54 | TUNNELS, |
| 55 | FLOWS, |
| 56 | VERSION |
| 57 | ) |
| 58 | .addProp(VERSION, MY_VERSION); |
| 59 | |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public void modifyDeviceDetails(PropertyPanel pp) { |
| 64 | pp.title(MY_TITLE); |
| 65 | pp.removeProps(LATITUDE, LONGITUDE); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 66 | |
Simon Hunt | 8d22c4b | 2015-08-06 16:24:43 -0700 | [diff] [blame] | 67 | pp.addButton(FOO_BUTTON) |
| 68 | .addButton(BAR_BUTTON); |
Simon Hunt | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame] | 69 | |
| 70 | pp.removeButtons(CoreButtons.SHOW_PORT_VIEW) |
Jian Li | 79f6732 | 2016-01-06 18:22:37 -0800 | [diff] [blame] | 71 | .removeButtons(CoreButtons.SHOW_GROUP_VIEW) |
| 72 | .removeButtons(CoreButtons.SHOW_METER_VIEW); |
Simon Hunt | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame] | 73 | } |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 74 | |
| 75 | } |