3 import java.util.ArrayList;
6 import com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication;
7 import com.kuka.roboticsAPI.uiModel.userKeys.IUserKeyBar;
8 import com.kuka.roboticsAPI.uiModel.userKeys.IUserKeyListener;
9 import com.kuka.roboticsAPI.uiModel.userKeys.IUserKey;
10 import com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment;
11 import com.kuka.roboticsAPI.uiModel.userKeys.UserKeyEvent;
15 private RoboticsAPIApplication _app;
17 private List<IUserKeyBar> generalKeyBars =
new ArrayList<IUserKeyBar>();
18 private List<IUserKey> generalKeys =
new ArrayList<IUserKey>();
19 private List<IUserKeyListener> generalKeyLists =
new ArrayList<IUserKeyListener>();
22 private IUserKeyBar startstopKeybar;
23 private IUserKey startstopKey;
24 private IUserKeyListener startstopKeyList;
25 private boolean startstopEnabled =
false;
26 private boolean startstopSwitched =
false;
34 startstopKeybar = _app.getApplicationUI().createUserKeyBar(
"startstop");
35 startstopKeyList =
new IUserKeyListener() {
37 public void onKeyEvent(IUserKey key, com.kuka.roboticsAPI.uiModel.userKeys.UserKeyEvent event) {
38 if (event == UserKeyEvent.FirstKeyDown) {
39 startstopEnabled =
true;
40 startstopSwitched =
true;
41 }
else if (event == UserKeyEvent.SecondKeyDown) {
42 startstopEnabled =
false;
43 startstopSwitched =
true;
47 startstopKey = startstopKeybar.addDoubleUserKey(0, startstopKeyList,
true);
48 startstopKey.setText(UserKeyAlignment.TopMiddle,
"ON");
49 startstopKey.setText(UserKeyAlignment.BottomMiddle,
"OFF");
50 startstopKeybar.publish();
55 return startstopEnabled;
StartStopSwitchUI(RoboticsAPIApplication app)