Re: Extending a Region to create a JUNG Layout
Except the license.txt page points to the OSI page that is... BSD 2 Clause. Here's the zoom pane as BSD 2 clause... https://github.com/shemnon/FollowTheBitcoin/commit/effd601965875fec8891f8202afea1f84f1daf54 If you really want me to add the non-endorsement clause I can, but it is kind of awkwardly worded for individual contributors. On Sun, Jun 1, 2014 at 10:49 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: BSD - 3 Clause - http://jung.sourceforge.net/license.txt On Sat, May 31, 2014 at 6:17 PM, Danno Ferrin danno.fer...@shemnon.com wrote: The new matrix classes exposed in JavaFX 8 help a lot. I'll re-license it BSD. 2 clause, 3 clause, new? Can you point me to a preferred header? On Fri, May 30, 2014 at 6:11 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Re: Extending a Region to create a JUNG Layout
Upps.. Controller compatible... -Sven Am 01.06.2014 10:34 schrieb Sven Reimers sven.reim...@gmail.com: Controller compatible? -Sven Am 01.06.2014 03:17 schrieb Danno Ferrin danno.fer...@shemnon.com: The new matrix classes exposed in JavaFX 8 help a lot. I'll re-license it BSD. 2 clause, 3 clause, new? Can you point me to a preferred header? On Fri, May 30, 2014 at 6:11 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Re: Extending a Region to create a JUNG Layout
Controller compatible? -Sven Am 01.06.2014 03:17 schrieb Danno Ferrin danno.fer...@shemnon.com: The new matrix classes exposed in JavaFX 8 help a lot. I'll re-license it BSD. 2 clause, 3 clause, new? Can you point me to a preferred header? On Fri, May 30, 2014 at 6:11 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Re: Extending a Region to create a JUNG Layout
BSD - 3 Clause - http://jung.sourceforge.net/license.txt On Sat, May 31, 2014 at 6:17 PM, Danno Ferrin danno.fer...@shemnon.com wrote: The new matrix classes exposed in JavaFX 8 help a lot. I'll re-license it BSD. 2 clause, 3 clause, new? Can you point me to a preferred header? On Fri, May 30, 2014 at 6:11 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Re: Extending a Region to create a JUNG Layout
The new matrix classes exposed in JavaFX 8 help a lot. I'll re-license it BSD. 2 clause, 3 clause, new? Can you point me to a preferred header? On Fri, May 30, 2014 at 6:11 PM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Extending a Region to create a JUNG Layout
Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff
Re: Extending a Region to create a JUNG Layout
Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
RE: Extending a Region to create a JUNG Layout
Much of the internal JavaFX implementation is performed subclassing Region (or Control which is just a Region subclass itself) and overriding layoutChildren, but I'm not aware of any official documentation on the subject other than the sparse stuff in the Javadoc - so no real tutorials. Maybe try studying some of the JavaFX source which extends Region. For example, take a look at Axis: https://bitbucket.org/openjfxmirrors/openjfx-8-master-rt/src/tip/modules/controls/src/main/java/javafx/scene/chart/Axis.java https://bitbucket.org/openjfxmirrors/openjfx-8-master-rt/src/tip/modules/controls/src/main/java/javafx/scene/chart/CategoryAxis.java It would be nice if Oracle or somebody else produced some documentation on this. You could create a feature request in Jira (https://javafx-jira.kenai.com) for such documentation or email the documentation team (javasedocs...@oracle.com), or write a blog or a openjfx wiki article (https://wiki.openjdk.java.net/display/OpenJFX/Main) if you work out some good techniques. John -Original Message- From: openjfx-dev [mailto:openjfx-dev-boun...@openjdk.java.net] On Behalf Of Jeffrey Guenther Sent: Thursday, May 29, 2014 11:45 PM To: openjfx-dev@openjdk.java.net Subject: Extending a Region to create a JUNG Layout Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff
Re: Extending a Region to create a JUNG Layout
It would be nice if Oracle or somebody else produced some documentation on this. You could create a feature request in Jira (https://javafx-jira.kenai.com) for such documentation or email the documentation team (javasedocs...@oracle.com), or write a blog or a openjfx wiki article (https://wiki.openjdk.java.net/display/OpenJFX/Main) if you work out some good techniques. Thanks John, that is good advice. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? Some quick pointers. First, layout is done asynchronously to the changes that cause the layout to have to occur. This is done so that we limit the number of times we layout a container. For example, if a container’s width changes, we mark that container (and on up the hierarchy) as needing a new layout, but we don’t perform the layout yet. If you were to then change the height for a container, we see that it has already been marked dirty and don’t have to go any further. Without this, we ended up with “layout storms”. Layouts happen once “per pulse”. A “pulse” happens once per rendering. So we get notification that we need to prepare the scene graph in order to render the next frame. So we do CSS, layout, etc and then synchronize those changes down to the graphics layer to draw. You don’t have to worry about the pulse. Just know that when the width / height / etc of a layout container changes, we mark it as dirty, and then perform layout *sometime before the next render happens*. In order to manually tell a region that it has a dirty layout, call requestLayout() on the region. When does a the region's parent call layoutChildren()? During the pulse. You can force a layout (which maybe is what you’re bumping up against), but normally if you can, you want to let the “once per pulse” mechanism cause layout to occur for you. During the layout pass, the layoutChildren() method on the region will be called. Inside this method you are responsible for taking into account any insets on the region (by calling getInsets()). If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? I assume you mean, when the prefWidth and prefHeight? The parent of the region will ask the region for its min/pref/max width and height, and will then decide what size to give your region. So in other words, the region doesn’t figure out its own width/height, it is told its width and height, *prior* to be being asked to layout its children. Richard
Re: Extending a Region to create a JUNG Layout
On May 30, 2014, at 10:55 AM, John Smith john_sm...@symantec.com wrote: Much of the internal JavaFX implementation is performed subclassing Region (or Control which is just a Region subclass itself) and overriding layoutChildren, but I'm not aware of any official documentation on the subject other than the sparse stuff in the Javadoc - so no real tutorials. Maybe try studying some of the JavaFX source which extends Region. For example, take a look at Axis: https://bitbucket.org/openjfxmirrors/openjfx-8-master-rt/src/tip/modules/controls/src/main/java/javafx/scene/chart/Axis.java https://bitbucket.org/openjfxmirrors/openjfx-8-master-rt/src/tip/modules/controls/src/main/java/javafx/scene/chart/CategoryAxis.java Good call. Axises should be pretty simple. In my search, I stumbled upon the source in grep code (though I know it is available from openjdk) and spent some time looking at HBox and VBox as they are on the simpler side of things. It would be nice if Oracle or somebody else produced some documentation on this. You could create a feature request in Jira (https://javafx-jira.kenai.com) for such documentation or email the documentation team (javasedocs...@oracle.com), or write a blog or a openjfx wiki article (https://wiki.openjdk.java.net/display/OpenJFX/Main) if you work out some good techniques. Never thought about a ticket for docs. Yeah, I plan to blog once I get feel for things.
Re: Extending a Region to create a JUNG Layout
Thank you for the feedback! Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? Some quick pointers. First, layout is done asynchronously to the changes that cause the layout to have to occur. This is done so that we limit the number of times we layout a container. For example, if a container’s width changes, we mark that container (and on up the hierarchy) as needing a new layout, but we don’t perform the layout yet. If you were to then change the height for a container, we see that it has already been marked dirty and don’t have to go any further. Without this, we ended up with “layout storms”. Layouts happen once “per pulse”. A “pulse” happens once per rendering. So we get notification that we need to prepare the scene graph in order to render the next frame. So we do CSS, layout, etc and then synchronize those changes down to the graphics layer to draw. You don’t have to worry about the pulse. Just know that when the width / height / etc of a layout container changes, we mark it as dirty, and then perform layout *sometime before the next render happens*. In order to manually tell a region that it has a dirty layout, call requestLayout() on the region. When does a the region's parent call layoutChildren()? During the pulse. You can force a layout (which maybe is what you’re bumping up against), but normally if you can, you want to let the “once per pulse” mechanism cause layout to occur for you. Hmm. I haven’t been forcing the layout. I’ve just overridden layoutChildren() to do the graph layout whenever it is called. (Trying to write as little code as necessary) During the layout pass, the layoutChildren() method on the region will be called. Inside this method you are responsible for taking into account any insets on the region (by calling getInsets()). So the content area width for rendering the children, for example, is the size provided by the parent less the left and right insets. How do you access the width and height the parent is requesting the region to be? For example, let’s say I have: @Override protected void layoutChildren() { super.layoutChildren(); // What methods do I call to get the desired width and height values from the parent to pass into the layout? doGraphLayout(?, ?); // layout takes a width and height and layouts out the network inside in those dimensions - creates Shapes adds them as children to the region } If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? I assume you mean, when the prefWidth and prefHeight? The parent of the region will ask the region for its min/pref/max width and height, and will then decide what size to give your region. So in other words, the region doesn’t figure out its own width/height, it is told its width and height, *prior* to be being asked to layout its children. Yes, sorry. prefWidth and prefHeight. And the parent calls resize(width, height)? So if I understand this correctly, rendering starts at the scene graphs root and layouts are computed down the tree. The scene size tells the root node what size it should be and then it calls layoutChildren(). If the region has children it manages, they are provide with a size they should be. They in turn layout their children. The process continues down the tree. So layouts are top down? And properties like hgrow, vgrow, etc control the layout behaviour? If I want to make my graph layout resizable, what do I need to do? Just implement resize(width, height)? Jeff
Re: Extending a Region to create a JUNG Layout
You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497
Re: Extending a Region to create a JUNG Layout
Danno, thanks! It works super well and has so little code! If I use the class in my JUNG work, I need a BSD license. The rest of that codebase is BSD already. I’ll contact you off list if I go that direction. Right now, I’m trying to get my head wrapped around what it would take to modernize JUNG. On May 30, 2014, at 4:20 PM, Danno Ferrin danno.fer...@oracle.com wrote: You may find this class valuable, it is a pane that listens to zoom and mouse scroll events in a group, essential for large graphs: https://github.com/shemnon/FollowTheBitcoin/blob/master/src/main/groovy/com/shemnon/btc/view/ZoomPane.java I haven't had time to harden it and componentize it into a standalone release. If you don't like the license let me know what license you would like. --Danno - Original Message - From: sven.reim...@gmail.com To: guenther.jeff...@gmail.com Cc: openjfx-dev@openjdk.java.net Sent: Friday, May 30, 2014 1:27:48 AM GMT -07:00 US/Canada Mountain Subject: Re: Extending a Region to create a JUNG Layout Hi Jeffrey, I did some prototyping with Jung JavaFX and Java 8, the results are here https://bitbucket.org/sreimers/jung8 It uses gradle to build and contains an additional library for jungfx. Enjoy -Sven On Fri, May 30, 2014 at 8:44 AM, Jeffrey Guenther guenther.jeff...@gmail.com wrote: Hi, I'm in the midst of exploring how I might port JUNG( http://jung.sourceforge.net/index.html) to JavaFX. JUNG is a graph/layout tool my lab uses for some of their data visualizations. With the release of JavaFX 2, we've started building our prototypes in JavaFX. Rather than use the JFXSwingPanel, I want to try modifying the JUNG to work natively in JavaFX. In the long term, I'd like to see JUNG ported completely to JavaFX using properties, CSS and the like. I've built a quick demo ( https://gist.github.com/jrguenther/9d0c37329f9928a2b56e) and need help going forward. I've been reading the docs and hitting google, but I think I need more info. Can someone point me to a detailed explanation of how to extend Region to create my own layout? In particular, how can I get a region to relayout it's children when it's being resized? When does a the region's parent call layoutChildren()? If the height and width of the region are set to Double.MAX_VALUE indicating the area can grow infinitely, how does the region know what size to set itself to? Thanks, Jeff -- Sven Reimers * Senior Expert Software Architect * NetBeans Dream Team Member: http://dreamteam.netbeans.org * Community Leader NetBeans: http://community.java.net/netbeans Desktop Java: http://community.java.net/javadesktop * JUG Leader JUG Bodensee: http://www.jug-bodensee.de * Duke's Choice Award Winner 2009 * Blog: https://www.java.net//blog/sven * XING: https://www.xing.com/profile/Sven_Reimers8 * LinkedIn: http://www.linkedin.com/in/svenreimers Join the NetBeans Groups: * XING: http://www.xing.com/group-20148.82db20 * NUGM: http://haug-server.dyndns.org/display/NUGM/Home * LinkedIn: http://www.linkedin.com/groups?gid=1860468 http://www.linkedin.com/groups?gid=107402 http://www.linkedin.com/groups?gid=1684717 * Oracle: https://mix.oracle.com/groups/18497