blob: 784630b2fa8ae585617d3921021b4786f9382184 [file] [log] [blame]
Simon Huntfb940112015-07-29 18:36:35 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Huntfb940112015-07-29 18:36:35 -07003 *
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
18package org.meowster.over;
19
20import org.onosproject.ui.UiTopoOverlay;
Simon Hunt8d22c4b2015-08-06 16:24:43 -070021import org.onosproject.ui.topo.ButtonId;
Simon Huntfb940112015-07-29 18:36:35 -070022import org.onosproject.ui.topo.PropertyPanel;
Simon Hunt01106b92015-08-04 20:14:53 -070023import org.onosproject.ui.topo.TopoConstants.CoreButtons;
Simon Huntfb940112015-07-29 18:36:35 -070024import org.onosproject.ui.topo.TopoConstants.Glyphs;
25
26import static org.onosproject.ui.topo.TopoConstants.Properties.*;
27
28/**
29 * Our topology overlay.
30 */
31public 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 Hunt01106b92015-08-04 20:14:53 -070038
Simon Hunt8d22c4b2015-08-06 16:24:43 -070039 private static final ButtonId FOO_BUTTON = new ButtonId("foo");
40 private static final ButtonId BAR_BUTTON = new ButtonId("bar");
Simon Huntfb940112015-07-29 18:36:35 -070041
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 Huntfb940112015-07-29 18:36:35 -070066
Simon Hunt8d22c4b2015-08-06 16:24:43 -070067 pp.addButton(FOO_BUTTON)
68 .addButton(BAR_BUTTON);
Simon Hunt01106b92015-08-04 20:14:53 -070069
70 pp.removeButtons(CoreButtons.SHOW_PORT_VIEW)
Jian Li79f67322016-01-06 18:22:37 -080071 .removeButtons(CoreButtons.SHOW_GROUP_VIEW)
72 .removeButtons(CoreButtons.SHOW_METER_VIEW);
Simon Hunt01106b92015-08-04 20:14:53 -070073 }
Simon Huntfb940112015-07-29 18:36:35 -070074
75}