-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeleteConnectionAction.java
More file actions
54 lines (45 loc) · 980 Bytes
/
DeleteConnectionAction.java
File metadata and controls
54 lines (45 loc) · 980 Bytes
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
51
52
53
54
class DeleteConnectionAction implements MenuAction
{
private ObjectProvider objects;
private Thing currentObject;
private int connectionA;
private int connectionB;
DeleteConnectionAction(ObjectProvider objects)
{
this.objects = objects;
this.currentObject = null;
}
public void setConnection(int indexA, int indexB)
{
this.connectionA = indexA;
this.connectionB = indexB;
}
public void setIndexA(int indexA)
{
this.connectionA = indexA;
}
public void setIndexB(int indexB)
{
this.connectionB = indexB;
}
public void setCurrentObject(Thing object)
{
this.currentObject = object;
}
public Thing getCurrentObject()
{
return this.currentObject;
}
public void unsetCurrentObject()
{
this.currentObject = null;
}
public boolean runAction()
{
if (currentObject != null)
{
objects.deleteConnection(connectionA, connectionB);
}
return false;
}
}