blob: f6a834153bffdf1d252d06a06f2cb86c2ddd9599 [file] [log] [blame]
Simon Huntfb940112015-07-29 18:36:35 -07001/*
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
18package org.meowster.over;
19
20import org.onosproject.ui.UiTopoOverlay;
Simon Hunt01106b92015-08-04 20:14:53 -070021import org.onosproject.ui.topo.ButtonDescriptor;
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
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 Huntfb940112015-07-29 18:36:35 -070044
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 Huntfb940112015-07-29 18:36:35 -070070
Simon Hunt01106b92015-08-04 20:14:53 -070071 pp.addButton(FOO_DESCRIPTOR)
72 .addButton(BAR_DESCRIPTOR);
73
74 pp.removeButtons(CoreButtons.SHOW_PORT_VIEW)
75 .removeButtons(CoreButtons.SHOW_GROUP_VIEW);
76 }
Simon Huntfb940112015-07-29 18:36:35 -070077
78}