blob: e0d7d239af835e7789274b50c5894ac9e98de2fa [file] [log] [blame]
Simon Hunte05cae42015-07-23 17:35:24 -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.
Simon Hunte05cae42015-07-23 17:35:24 -070015 */
16
17package org.onosproject.ui;
18
Simon Hunt0af1ec32015-07-24 12:17:55 -070019import org.onosproject.ui.topo.PropertyPanel;
Simon Hunte05cae42015-07-23 17:35:24 -070020import org.slf4j.Logger;
21import org.slf4j.LoggerFactory;
22
23/**
24 * Represents user interface topology view overlay.
25 */
26public class UiTopoOverlay {
27
Simon Huntb745ca62015-07-28 15:37:11 -070028 /**
29 * Logger for this overlay.
30 */
31 protected final Logger log = LoggerFactory.getLogger(getClass());
Simon Hunte05cae42015-07-23 17:35:24 -070032
33 private final String id;
34
Simon Huntd2862c32015-08-24 17:41:51 -070035 private boolean isActive = false;
36
Simon Hunte05cae42015-07-23 17:35:24 -070037 /**
38 * Creates a new user interface topology view overlay descriptor.
39 *
40 * @param id overlay identifier
41 */
42 public UiTopoOverlay(String id) {
43 this.id = id;
44 }
45
46 /**
47 * Returns the identifier for this overlay.
48 *
49 * @return the identifier
50 */
51 public String id() {
52 return id;
53 }
54
55 /**
56 * Callback invoked to initialize this overlay, soon after creation.
57 * This default implementation does nothing.
58 */
59 public void init() {
60 }
61
62 /**
63 * Callback invoked when this overlay is activated.
64 */
65 public void activate() {
Simon Huntd2862c32015-08-24 17:41:51 -070066 isActive = true;
Simon Hunte05cae42015-07-23 17:35:24 -070067 }
68
69 /**
70 * Callback invoked when this overlay is deactivated.
71 */
72 public void deactivate() {
Simon Huntd2862c32015-08-24 17:41:51 -070073 isActive = false;
74 }
75
76 /**
77 * Returns true if this overlay is currently active.
78 *
79 * @return true if overlay active
80 */
81 public boolean isActive() {
82 return isActive;
Simon Hunte05cae42015-07-23 17:35:24 -070083 }
84
85 /**
86 * Callback invoked to destroy this instance by cleaning up any
87 * internal state ready for garbage collection.
Simon Huntb745ca62015-07-28 15:37:11 -070088 * This default implementation holds no state and does nothing.
Simon Hunte05cae42015-07-23 17:35:24 -070089 */
90 public void destroy() {
91 }
Simon Hunt0af1ec32015-07-24 12:17:55 -070092
93 /**
94 * Callback to modify the contents of the summary panel.
95 * This default implementation does nothing.
96 *
97 * @param pp property panel model of summary data
98 */
99 public void modifySummary(PropertyPanel pp) {
100 }
Simon Huntb745ca62015-07-28 15:37:11 -0700101
102 /**
103 * Callback to modify the contents of the details panel for
104 * a selected device.
105 * This default implementation does nothing.
106 *
107 * @param pp property panel model of summary data
108 */
109 public void modifyDeviceDetails(PropertyPanel pp) {
110 }
111
112 /**
113 * Callback to modify the contents of the details panel for
114 * a selected host.
115 * This default implementation does nothing.
116 *
117 * @param pp property panel model of summary data
118 */
119 public void modifyHostDetails(PropertyPanel pp) {
120 }
Simon Hunte05cae42015-07-23 17:35:24 -0700121}