ONOS-2186 - GUI Topo Overlay - (WIP)
- added isActive() predicate to UiTopoOverlay.
- auto-select single intent in an intent selection group.
- clean up mouse over/out handling.
Change-Id: I0f951bd26fcfc791d73bb8121ebbe002086294ea
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopoOverlayCache.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopoOverlayCache.java
index f7690e8..99557c2 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopoOverlayCache.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopoOverlayCache.java
@@ -30,6 +30,7 @@
*/
public class TopoOverlayCache {
+ private static final String EMPTY = "";
private static final UiTopoOverlay NONE = new NullOverlay();
private final Map<String, UiTopoOverlay> overlays = new HashMap<>();
@@ -95,20 +96,21 @@
return overlays.size();
}
+ /**
+ * Returns true if the identifier of the currently active overlay
+ * matches the given parameter.
+ *
+ * @param overlayId overlay identifier
+ * @return true if this matches the ID of currently active overlay
+ */
+ public boolean isActive(String overlayId) {
+ return currentOverlay().id().equals(overlayId);
+ }
// overlay instance representing "no overlay selected"
private static class NullOverlay extends UiTopoOverlay {
public NullOverlay() {
- super(null);
- }
-
- // override activate and deactivate, so no log messages are written
- @Override
- public void activate() {
- }
-
- @Override
- public void deactivate() {
+ super(EMPTY);
}
}
}