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