Created
January 7, 2010 12:30
-
-
Save bluepapa32/271205 to your computer and use it in GitHub Desktop.
Node から JComponent 取得
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.scene.Node; | |
import javafx.reflect.FXLocal; | |
// com.sun.javafx.tk.swing.SwingScene$SwingScenePanel | |
function getPanel(node: Node) { | |
var context = FXLocal.getContext(); | |
// SGNode | |
var nodeClass = context.makeClassRef(node.getClass()); | |
var impl_getPGNode = nodeClass.getFunction("impl_getPGNode"); | |
var sgNode = impl_getPGNode.invoke(context.mirrorOf(node)) as FXLocal.ObjectValue; | |
// Panel | |
var panel = sgNode.getClassType().getFunction("getPanel").invoke(sgNode); | |
return (panel as FXLocal.ObjectValue).asObject(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment