Multitouch Table FH Ingolstadt: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
MT4J offers the possibility to integrate Swing Components and thereby enables the user
to include existing applications ofor single Swing components.
To display these components, MT4J provides a SwingTextureRenderer-Object.
In a sample application, the SwingTextureRenderer was added to a MTTextKeyboard as a child
component, PersistentContentPane is a Swing object:
component.
 
public void addImage(PersistentContentPane cp) {
swing_app = cp;
str = new SwingTextureRenderer(app, swing_app);
str.scheduleRefresh();
final MTImage m = new MTImage(app, str.getTextureToRenderTo());
m.setPositionRelativeToParent(new Vector3D(100, -100, 0));
this.addChild(m);
}
 
During the evaluation of the SwingTextureRenderer, especially 2 things were of great interest:
# which rendering update frequency is necessary, to provide a smooth user experience, is the
#:performance of SwingTextureRenderers sufficient for that
# how is it possible, to forward MT4J user input to the swing application
 
# how is possible, to forward MT4J user input to the swing application
 
concerning 1.
An update-rate of 150ms has proven to be appropriate, however higher raterates were possible as well,
100ms and even below.
A possible pitfall is the code-location, in which the scheduleRefresh-method of SwingTextureRenderers (str)
public void run() {
swing_app.getEditorWindow().getTextPane().requestFocusInWindow();
queue.postEvent(new KeyEvent(swing_app.getEditorWindow().getTextPane(),
KeyEvent.KEY_TYPED,
Unfortunately, this solution turned out to be a dead end.
The events could't be dispatched/processed by the Swing-component.
A possible way to go, is sending the event nonot to the Swing-component (e.g. JFrame) itself but to the
underlying document-object.
 
6

Bearbeitungen

Navigationsmenü