nakamin
01/04/2017, 5:49 PMdot not
nakamin
01/04/2017, 5:50 PMdot not
receive any event(like onDock). The reason was that he manually instantiated the fragments:ron
01/04/2017, 5:51 PMedvin
01/04/2017, 5:52 PMCtrl-Alt-S
😁ron
01/04/2017, 5:53 PMedvin
01/04/2017, 5:53 PMpermalmberg
01/04/2017, 6:10 PMpermalmberg
01/04/2017, 6:11 PMpermalmberg
01/04/2017, 6:23 PMFragment
unless I'm misstaken? Sure, if you do by inject()
I guess it becomes a singleton, but since that isn't the idea with a Fragment
the statement becomes somewhat confusing.ron
01/04/2017, 6:24 PMron
01/04/2017, 6:24 PMron
01/04/2017, 6:26 PMron
01/04/2017, 6:26 PMpermalmberg
01/04/2017, 6:26 PMron
01/04/2017, 6:28 PMpermalmberg
01/04/2017, 6:29 PMpermalmberg
01/04/2017, 6:30 PMron
01/04/2017, 6:32 PMjchildress
01/04/2017, 6:34 PMpermalmberg
01/04/2017, 6:39 PMclass WireView(source: OutputView, target: InputView) : Line()
I want to bind the `startX/Y `and endX/Y
properties to another view so that the ends of the line moves when the other view. As such, in the other view (a Fragment
) I do:
override fun bindPosition(wire: WireView) {
wire.endXProperty().bind( root.layoutXProperty())
wire.endYProperty().bind( root.layoutYProperty())
}
The binding in it self seems to work, but the problem is that root.layoutX
is local to that Fragment
. Is there an easy way to transform the local coordinate system to that of the view that the Fragment
is contained by? As I type this, I remember reading about using a converter for bindings, perhaps that is the way?edvin
01/04/2017, 6:42 PMcarlw
01/04/2017, 6:43 PMRuckus
01/04/2017, 6:43 PMlocalToScene
and localToParent
edvin
01/04/2017, 6:44 PMedvin
01/04/2017, 6:45 PMlocalToScene
will give you scene coordinates if you pass in boundsInLocal
.carlw
01/04/2017, 6:47 PMcarlw
01/04/2017, 6:48 PMcarlw
01/04/2017, 6:48 PM