-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClickButton.pde
More file actions
49 lines (45 loc) · 1.28 KB
/
Copy pathClickButton.pde
File metadata and controls
49 lines (45 loc) · 1.28 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
public class ClickButton extends Button2D {
int path;
public ClickButton(Scene scn, PVector p, PFont font, int index) {
this(scn, p, font, "", index);
}
public ClickButton(Scene scn, PVector p, PFont font, String t, int index) {
super(scn, p, font, t);
path = index;
}
@Override
public void performInteraction(ClickEvent event) {
if (event.clickCount() == 1)
if (path == 0)
scene.togglePathsVisualHint();
else
scene.eye().playPath(path);
}
public void display() {
String text = new String();
if (path == 0)
if (scene.pathsVisualHint())
text = "don't edit camera paths";
else
text = "edit camera paths";
else {
if (grabsInput(scene.motionAgent())) {
if (scene.eye().keyFrameInterpolator(path).numberOfKeyFrames() > 1)
if (scene.eye().keyFrameInterpolator(path).interpolationStarted())
text = "stop path ";
else
text = "play path ";
else
text = "restore position ";
} else {
if (scene.eye().keyFrameInterpolator(path).numberOfKeyFrames() > 1)
text = "path ";
else
text = "position ";
}
text += ((Integer) path).toString();
}
setText(text);
super.display();
}
}