-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConnectionsMenuAction.java
More file actions
50 lines (42 loc) · 1.04 KB
/
ConnectionsMenuAction.java
File metadata and controls
50 lines (42 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import processing.core.PApplet;
class ConnectionsMenuAction implements MenuAction
{
private Thing currentObject;
private HUD hud;
private PApplet context;
private ColorConfiguration config;
ConnectionsMenuAction(PApplet context, HUD hud, ColorConfiguration config)
{
this.currentObject = null;
this.hud = hud;
this.context = context;
this.config = config;
}
public void setCurrentObject(Thing object)
{
this.currentObject = object;
}
public void unsetCurrentObject()
{
this.currentObject = null;
}
public boolean runAction()
{
HUDObject connectionsHud = this.hud.get("Connections");
HUDObject loginHud = this.hud.get("Login");
if (loginHud != null)
{
this.hud.deactivateObject("Login");
}
if (connectionsHud == null)
{
this.hud.addObject(new ConnectionsHUD(context, config));
this.hud.activateObject("Connections");
}
else
{
connectionsHud.activate();
}
return false;
}
}