Running the ConferenceScheduleApp on a Raspberry Pi
thilo-openjfx-dev at gebit.de
thilo-openjfx-dev at gebit.de
Thu Jan 10 13:05:35 PST 2013
Hi,
just in case someone wants to run the ConferenceScheduleApp that was
demoed at JavaOne 2012 on a Raspberry Pi here's a few hints because it
wasn't that straight forward...
First of all you have to patch the source code because it uses removed
(internal) methods ScrollEvent.impl_scrollEvent(...) and
KeyEvent.impl_keyEvent(...). I'm not 100% sure whether my patch is right
but at least the application runs. (See patch at the end of this mail.)
I decided to compile it on the Raspberry Pi itself using JDK 8 (with
JavaFX) for ARM Early Access to avoid problems with incompatible changes.
The version I used was from openjfx/8/master/rt.
In directory rt/apps/experiments/ConferenceScheduleApp compile with
ant -Dplatforms.Default_JavaFX_Platform.home=/opt/jdk1.8.0
-Djavafx.runtime=/opt/jdk1.8.0/jre
Packaging didn't quite work yet so I simply ran it from the build
directory with
java -Djavafx.platform=eglfb -cp
/opt/jdk1.8.0/jre/lib/jfxrt.jar:classes
com.javafx.experiments.scheduleapp.ConferenceScheduleApp
Maybe it runs not as fast as the BeagleBoard version shown at JavaOne but
performance is still quite impressive. And of course the
ConferenceScheduleApp itself is an outstanding example of the powers of
JavaFX! Great work, lads!
Cheers...
Thilo
diff -r e25ee61a987d
apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/TouchScrollEventSynthesizer.java
---
a/apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/TouchScrollEventSynthesizer.java
Thu Jan 03 14:35:53 2013 -0800
+++
b/apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/TouchScrollEventSynthesizer.java
Thu Jan 10 21:53:05 2013 +0100
@@ -116,17 +116,18 @@
}
if (clickThresholdBroken) {
// TODO
- Event.fireEvent(e.getTarget(),
ScrollEvent.impl_scrollEvent(
- ScrollEvent.SCROLL,
+ ScrollEvent tempScrollEvent = new ScrollEvent(null,
e.getTarget(),
+ ScrollEvent.SCROLL,
scrollDistX, scrollDistY,
scrollDistX, scrollDistY,
+ me.isShiftDown(), me.isControlDown(),
me.isAltDown(), me.isMetaDown(),
+ true, false,
+ me.getX(), me.getY(),
+ me.getSceneX(), me.getSceneY(),
ScrollEvent.HorizontalTextScrollUnits.NONE,
0,
ScrollEvent.VerticalTextScrollUnits.NONE, 0,
- 0,
- me.getX(), me.getY(),
- me.getSceneX(), me.getSceneY(),
- me.isShiftDown(), me.isControlDown(),
me.isAltDown(), me.isMetaDown(),
- true, false));
+ 0);
+ Event.fireEvent(e.getTarget(), tempScrollEvent);
}
} else if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
handleRelease(me);
@@ -179,17 +180,18 @@
final double dragStepY = mouseY - lastMouseY;
if (Math.abs(dragStepX) >= 1.0 || Math.abs(dragStepY)
>= 1.0) {
- Event.fireEvent(me.getTarget(),
ScrollEvent.impl_scrollEvent(
- ScrollEvent.SCROLL,
+ ScrollEvent tempScrollEvent = new
ScrollEvent(null, me.getTarget(),
+ ScrollEvent.SCROLL,
dragStepX, dragStepY,
(distanceX * get()), (distanceY * get()),
+ me.isShiftDown(), me.isControlDown(),
me.isAltDown(), me.isMetaDown(),
+ true, true,
+ me.getX(), me.getY(),
+ me.getSceneX(), me.getSceneY(),
ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
ScrollEvent.VerticalTextScrollUnits.NONE,
0,
- 0,
- me.getX(), me.getY(),
- me.getSceneX(), me.getSceneY(),
- me.isShiftDown(), me.isControlDown(),
me.isAltDown(), me.isMetaDown(),
- true, true));
+ 0);
+ Event.fireEvent(me.getTarget(), tempScrollEvent);
}
lastMouseX = mouseX;
lastMouseY = mouseY;
diff -r e25ee61a987d
apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/control/VirtualKeyboardSkin.java
---
a/apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/control/VirtualKeyboardSkin.java
Thu Jan 03 14:35:53 2013 -0800
+++
b/apps/experiments/ConferenceScheduleApp/src/com/javafx/experiments/scheduleapp/control/VirtualKeyboardSkin.java
Thu Jan 10 21:53:05 2013 +0100
@@ -259,8 +259,8 @@
}
protected KeyEvent event(EventType<KeyEvent> type) {
- return KeyEvent.impl_keyEvent(getSkinnable(), chars, "", 0,
- shiftDown, false, false, false,
type);
+ // TODO: how to pass getSkinnable()?
+ return new KeyEvent(type, chars, "", 0, shiftDown, false,
false, false);
}
}
@@ -341,8 +341,8 @@
protected KeyEvent event(EventType<KeyEvent> type) {
if (type == KeyEvent.KEY_PRESSED || type ==
KeyEvent.KEY_RELEASED) {
- return KeyEvent.impl_keyEvent(getSkinnable(), chars,
chars, code.impl_getCode(),
- shiftDown, false, false,
false, type);
+ // TODO: how to pass getSkinnable()?
+ return new KeyEvent(type, chars, chars,
code.impl_getCode(), shiftDown, false, false, false);
} else {
return super.event(type);
}
More information about the openjfx-dev
mailing list