Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 1 | #set( $symbol_pound = '#' ) |
| 2 | #set( $symbol_dollar = '$' ) |
| 3 | #set( $symbol_escape = '\' ) |
| 4 | /* |
Jian Li | 79f6732 | 2016-01-06 18:22:37 -0800 | [diff] [blame] | 5 | * Copyright 2014-2016 Open Networking Laboratory |
Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 6 | * |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | */ |
| 19 | package ${package}; |
| 20 | |
Simon Hunt | de99e0b | 2015-10-23 18:54:06 -0700 | [diff] [blame] | 21 | import org.onosproject.net.DeviceId; |
Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 22 | import org.onosproject.ui.UiTopoOverlay; |
| 23 | import org.onosproject.ui.topo.ButtonId; |
| 24 | import org.onosproject.ui.topo.PropertyPanel; |
| 25 | import org.onosproject.ui.topo.TopoConstants.CoreButtons; |
| 26 | import org.onosproject.ui.topo.TopoConstants.Glyphs; |
| 27 | |
Simon Hunt | de99e0b | 2015-10-23 18:54:06 -0700 | [diff] [blame] | 28 | import static org.onosproject.ui.topo.TopoConstants.Properties.FLOWS; |
| 29 | import static org.onosproject.ui.topo.TopoConstants.Properties.INTENTS; |
| 30 | import static org.onosproject.ui.topo.TopoConstants.Properties.LATITUDE; |
| 31 | import static org.onosproject.ui.topo.TopoConstants.Properties.LONGITUDE; |
| 32 | import static org.onosproject.ui.topo.TopoConstants.Properties.TOPOLOGY_SSCS; |
| 33 | import static org.onosproject.ui.topo.TopoConstants.Properties.TUNNELS; |
| 34 | import static org.onosproject.ui.topo.TopoConstants.Properties.VERSION; |
Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Our topology overlay. |
| 38 | */ |
| 39 | public class AppUiTopovOverlay extends UiTopoOverlay { |
| 40 | |
| 41 | // NOTE: this must match the ID defined in sampleTopov.js |
| 42 | private static final String OVERLAY_ID = "meowster-overlay"; |
| 43 | |
| 44 | private static final String MY_TITLE = "My App Rocks!"; |
| 45 | private static final String MY_VERSION = "Beta-1.0.0042"; |
| 46 | private static final String MY_DEVICE_TITLE = "I changed the title"; |
| 47 | |
| 48 | private static final ButtonId FOO_BUTTON = new ButtonId("foo"); |
| 49 | private static final ButtonId BAR_BUTTON = new ButtonId("bar"); |
| 50 | |
| 51 | public AppUiTopovOverlay() { |
| 52 | super(OVERLAY_ID); |
| 53 | } |
| 54 | |
| 55 | |
| 56 | @Override |
| 57 | public void modifySummary(PropertyPanel pp) { |
| 58 | pp.title(MY_TITLE) |
| 59 | .typeId(Glyphs.CROWN) |
| 60 | .removeProps( |
| 61 | TOPOLOGY_SSCS, |
| 62 | INTENTS, |
| 63 | TUNNELS, |
| 64 | FLOWS, |
| 65 | VERSION |
| 66 | ) |
| 67 | .addProp(VERSION, MY_VERSION); |
| 68 | } |
| 69 | |
| 70 | @Override |
Simon Hunt | de99e0b | 2015-10-23 18:54:06 -0700 | [diff] [blame] | 71 | public void modifyDeviceDetails(PropertyPanel pp, DeviceId deviceId) { |
Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 72 | pp.title(MY_DEVICE_TITLE); |
| 73 | pp.removeProps(LATITUDE, LONGITUDE); |
| 74 | |
| 75 | pp.addButton(FOO_BUTTON) |
| 76 | .addButton(BAR_BUTTON); |
| 77 | |
| 78 | pp.removeButtons(CoreButtons.SHOW_PORT_VIEW) |
Jian Li | 79f6732 | 2016-01-06 18:22:37 -0800 | [diff] [blame] | 79 | .removeButtons(CoreButtons.SHOW_GROUP_VIEW) |
| 80 | .removeButtons(CoreButtons.SHOW_METER_VIEW); |
Simon Hunt | 1ee0985 | 2015-09-29 12:28:14 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | } |