blob: 188878179c07f97c02f77cc2915d1f0bae6235bc [file] [log] [blame]
Simon Hunt1ee09852015-09-29 12:28:14 -07001#set( $symbol_pound = '#' )
2#set( $symbol_dollar = '$' )
3#set( $symbol_escape = '\' )
4/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07005 * Copyright ${year}-present Open Networking Foundation
Simon Hunt1ee09852015-09-29 12:28:14 -07006 *
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 */
19package ${package};
20
Simon Huntde99e0b2015-10-23 18:54:06 -070021import org.onosproject.net.DeviceId;
Simon Hunt1ee09852015-09-29 12:28:14 -070022import org.onosproject.ui.UiTopoOverlay;
23import org.onosproject.ui.topo.ButtonId;
24import org.onosproject.ui.topo.PropertyPanel;
25import org.onosproject.ui.topo.TopoConstants.CoreButtons;
Simon Huntb9416182016-09-21 10:11:59 -070026import org.onosproject.ui.GlyphConstants;
Simon Hunt1ee09852015-09-29 12:28:14 -070027
Simon Huntde99e0b2015-10-23 18:54:06 -070028import static org.onosproject.ui.topo.TopoConstants.Properties.FLOWS;
29import static org.onosproject.ui.topo.TopoConstants.Properties.INTENTS;
30import static org.onosproject.ui.topo.TopoConstants.Properties.LATITUDE;
31import static org.onosproject.ui.topo.TopoConstants.Properties.LONGITUDE;
32import static org.onosproject.ui.topo.TopoConstants.Properties.TOPOLOGY_SSCS;
33import static org.onosproject.ui.topo.TopoConstants.Properties.TUNNELS;
34import static org.onosproject.ui.topo.TopoConstants.Properties.VERSION;
Simon Hunt1ee09852015-09-29 12:28:14 -070035
36/**
37 * Our topology overlay.
38 */
39public 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)
Ray Milkeya2c90ff2017-08-29 10:14:10 -070059 .glyphId(GlyphConstants.CROWN)
Simon Hunt1ee09852015-09-29 12:28:14 -070060 .removeProps(
61 TOPOLOGY_SSCS,
62 INTENTS,
63 TUNNELS,
64 FLOWS,
65 VERSION
66 )
Ray Milkeyc4b46d32019-02-25 09:15:50 -080067 .addProp(VERSION, VERSION, MY_VERSION);
Simon Hunt1ee09852015-09-29 12:28:14 -070068 }
69
70 @Override
Simon Huntde99e0b2015-10-23 18:54:06 -070071 public void modifyDeviceDetails(PropertyPanel pp, DeviceId deviceId) {
Simon Hunt1ee09852015-09-29 12:28:14 -070072 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 Li79f67322016-01-06 18:22:37 -080079 .removeButtons(CoreButtons.SHOW_GROUP_VIEW)
80 .removeButtons(CoreButtons.SHOW_METER_VIEW);
Simon Hunt1ee09852015-09-29 12:28:14 -070081 }
82
83}