canvas4.addControlListener(newResizeHandler(canvas4, lwjglCanvasRenderer4));
final SwtKeyboardWrapper keyboardWrapper = new SwtKeyboardWrapper(canvas1);
final SwtMouseWrapper mouseWrapper = new SwtMouseWrapper(canvas1);
final SwtFocusWrapper focusWrapper = new SwtFocusWrapper(canvas1);
final SwtMouseManager mouseManager = new SwtMouseManager(canvas1);
final ControllerWrapper controllerWrapper = new DummyControllerWrapper();
final PhysicalLayer pl = new PhysicalLayer(keyboardWrapper, mouseWrapper, controllerWrapper, focusWrapper);
logicalLayer.registerInput(canvas1, pl);
logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.H), new TriggerAction() {
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
if (source != canvas1) {
return;
}
if (_showCursor1.get(canvas1)) {
mouseManager.setCursor(_cursor1);
} else {
mouseManager.setCursor(_cursor2);
}
_showCursor1.put(canvas1, !_showCursor1.get(canvas1));
}
}));
logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.J), new TriggerAction() {
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
if (source != canvas1) {
return;
}
mouseManager.setCursor(MouseCursor.SYSTEM_DEFAULT);
}
}));
logicalLayer.registerTrigger(new InputTrigger(new KeyPressedCondition(Key.G), new TriggerAction() {
public void perform(final Canvas source, final TwoInputStates inputStates, final double tpf) {
if (source != canvas1) {
return;
}
mouseManager.setGrabbed(mouseManager.getGrabbed() == GrabbedState.NOT_GRABBED ? GrabbedState.GRABBED
: GrabbedState.NOT_GRABBED);
}
}));
final AWTImageLoader awtImageLoader = new AWTImageLoader();