Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Open Networking Laboratory |
| 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 | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame^] | 21 | import org.onosproject.ui.topo.ButtonDescriptor; |
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 | |
| 39 | private static final ButtonDescriptor FOO_DESCRIPTOR = |
| 40 | new ButtonDescriptor("foo", "chain", "A FOO action"); |
| 41 | |
| 42 | private static final ButtonDescriptor BAR_DESCRIPTOR = |
| 43 | new ButtonDescriptor("bar", "*banner", "A BAR action"); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 44 | |
| 45 | |
| 46 | public AppUiTopoOverlay() { |
| 47 | super(OVERLAY_ID); |
| 48 | } |
| 49 | |
| 50 | |
| 51 | @Override |
| 52 | public void modifySummary(PropertyPanel pp) { |
| 53 | pp.title("My App Rocks!") |
| 54 | .typeId(Glyphs.CROWN) |
| 55 | .removeProps( |
| 56 | TOPOLOGY_SSCS, |
| 57 | INTENTS, |
| 58 | TUNNELS, |
| 59 | FLOWS, |
| 60 | VERSION |
| 61 | ) |
| 62 | .addProp(VERSION, MY_VERSION); |
| 63 | |
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public void modifyDeviceDetails(PropertyPanel pp) { |
| 68 | pp.title(MY_TITLE); |
| 69 | pp.removeProps(LATITUDE, LONGITUDE); |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 70 | |
Simon Hunt | 01106b9 | 2015-08-04 20:14:53 -0700 | [diff] [blame^] | 71 | pp.addButton(FOO_DESCRIPTOR) |
| 72 | .addButton(BAR_DESCRIPTOR); |
| 73 | |
| 74 | pp.removeButtons(CoreButtons.SHOW_PORT_VIEW) |
| 75 | .removeButtons(CoreButtons.SHOW_GROUP_VIEW); |
| 76 | } |
Simon Hunt | fb94011 | 2015-07-29 18:36:35 -0700 | [diff] [blame] | 77 | |
| 78 | } |