Its Super Crazy Nesting Nightmare Might Mean JavaFX's Death...

...unless there are tools like this:

Or is it just me? I don't see myself ever seriously using a shiny PhotoShop-like designer for working with JavaFX (although I am really looking forward to there being that kind of support). I do, however, see myself wanting to get further into JavaFX. But, with all those brackets within brackets, it's a lot like XML hell in other technologies. I reckon that only with tools like the little code generator I built, shown above, can that problem be overcome. By the way, how is everyone else doing it so far? How are you making sure all those brackets are lined up correctly? If there's interest in it (though it's not very smart, e.g., doesn't add any import statements, but simply adds the selected tag around the selected characters, without even reformatting anything), I will put it in the NetBeans Plugin Portal.

Comments:

Huh? Isn't that what the IDE is for? To help you with this kind of thing? And how are the curly braces in JavaFX significantly different from the ones used in Groovy or Java or C ?? I think curly braces are an improvement over wordy representation such as block structures in Pascal/Algol-like languages or the tag structures in XML. The only escape I've heard of from something like curly braces is the idea of using whitespace indentation like they do in Python, but ever since I heard of that language 15+ years ago I thought that was a really poor idea such as the problems of getting Makefile indentation to be correct.

Posted by David Herron on December 15, 2008 at 05:41 AM PST #

So if you have, say, ten closing curly braces (because of all the things that are in your scene), and you decide to put some of the existing nodes into a new VBox (i.e., one that you haven't created yet), what do you do? How do you do it? That's not a situation I'm ever confronted with in any other language.

Posted by Geertjan on December 15, 2008 at 06:17 AM PST #

Hey Geertjan,
I'm not sure, why do you immediately reject the possibility of using a Photoshop-like GUI designer for laying out the ? I know you're a Linux fan like me and I do recall reading about an InkScape plugin that exports to JavaFx. I agree with you that unless working w/ Photoshop is my 8 hr job, it's unlikely that I'll spend a few hundred bucks on a license, but a free tool like InkScape that can give me the basics if VERY desirable in my opinion.

I agree that some level of abstraction would be nice : e.g. being able to look at only a particular block of code - similarly to the way when you use NetBeans you can only view & design a particular panel in the app (instead of designing the panel within all containing windows in the GUI designer).

Anyway, the JavaFx in Action is in MEAP in Manning, I just got a copy, I'll try to set aside some time over the next couple of weeks to dig in....

Posted by Alex Kotchnev on December 15, 2008 at 07:37 AM PST #

\* I think that the point of the photoshop plugin is to make it easier for designers to work with developers, to help normalize image data.

\* the nested syntax really isn't that difficult. It's much more sensible than creating anonymous inner classes to handle mouse events, IMO. If you've spent any time working with the EXTJS framework, or Groovy builders, JavaFX will feel pretty similar.

\* It won't belong before IDEs start making JavaFX plugins. Intellij will make one that will make hand-coding JavaFX a breeze.

\* For the non-hand-coders, there will be Flash-like environments where you can manipulate your Nodes (aka Symbols/Movie Clips) and Timelines -- I think the language is well suited for graphical IDEs

I admit that I'm reluctant to put much work into building a serious JavaFX project without the benefit a nice IDE (haven't tried netbeans, but the current eclipse plugin adds very little value), but I'm very optimistic about JavaFX's future.

Posted by mark on December 15, 2008 at 10:22 AM PST #

I find the code much cleaner if you put all attributes in the same line (except for sequences or long objects)

something like this

Stage {
title: "Application Title", width: 250, | height: 80,
scene: Scene { content: [
Text { font: Font { size: 12 }, x: 10, | y: 30, content: "Application Content" }
] }
}

Posted by azdrubal on December 15, 2008 at 10:53 AM PST #

@azdrubal: That's a good idea. Unfortunately, right now, in the NetBeans plugin, when you use the menu item for reformatting the code, all the braces end up on new lines. There should be an option to have the formatting appear as shown by you here.
<p>
@mark: Yes, that's also my interpretation, about the designer not being intended for programmers, but for non-programmers to be able to communicate with programmers, hence programmers will be left with working in an editor, hence editor support is really important.
<p>
@Alex: JavaFX in Action sounds very interesting.

Posted by Geertjan on December 15, 2008 at 06:03 PM PST #

Is JavaFX not supported by the UI builder/Mattiese? Would have expected a dnd design view or is your problem inserting & altering the existing layout in ways the ui builder dosn't allow.

Posted by Richard Osbaldeston on December 15, 2008 at 09:14 PM PST #

Right, there's no UI builder at all, hence my problem. That's what I image the designer will consist of in some way.

Posted by Geertjan Wielenga on December 16, 2008 at 09:33 PM PST #

I suppose a GUI builder presupposes some kind of LayoutManager which conflicts with the simple declarative features of JavaFX Script. But that declarative syntax is pretty limited in terms of trying to describe a layout with all its groupings, alignments, resizing polices etc.. OTOH Even with Matisse inserting or changing a components type (eg textfield to editorpane) can prove fiddly though, esp where all the spare space gets added.

Wonder if the JavaFX CSS feature is able to reposition, align & float elements? do the definitions cascade? When they talked of CSS I was thinking of the style information being inherited from the browsers DOM (i.e. active stylesheets of the parent/document/page). Maybe with custom-selectors for the JavaFX specific stuff.

..or maybe the term CSS skinning is as ill advised as Swing2.0?

Posted by Richard Osbaldeston on December 17, 2008 at 09:43 PM PST #

Long ago I suggested giving the editor a somewhat tinted background color, and then rotating the hue of that background to show different levels of nesting - so you could always see where a block begins and ends.

You could possibly do it brightness as well, but you have to be careful with the algorithm that computes the foreground color to not end up with gray on gray or black on black.

Posted by Tim Boudreau on December 18, 2008 at 04:07 AM PST #

Like the View Source Chart extension? http://jennifermadden.com/scripts/ViewRenderedSource.html

Posted by Richard Osbaldeston on December 18, 2008 at 07:56 AM PST #

"..or maybe the term CSS skinning is as ill advised as Swing2.0?"

Missing the point.

Posted by Wade Chandler on December 20, 2008 at 09:49 AM PST #

Braces hell would be solved if I could align braces vertically.

Prefer the notation, with javafx can't do that.
{
..loop
..{
..}
}

. = spaces

Posted by Vince on February 06, 2009 at 04:41 AM PST #

Hey Geertjan,

A similar situation exists for LISP programmers. Wags have called LISP Lots of Irritating Single Parenthesis because in LISP you have a great many levels, like 20 or more, of nested parenthesis and what the program means depends on what's scoped by those parenthesis. Your program be interpreted and be run just fine but with a semantics you never intended.

I learned to program in LISP using emacs. emacs' concession to programmers on the user interface front with respect to the parenthesis issue was this- when you put the cursor on a closing paren, it would flip back and forth between that closing paren and its associated opening paren, showing each in reverse video for a beat.

I also had to walk to school for three miles in the snow without shoes.

So quite your complaining ;)

Seriously, the success of JavaFX will lie in no small measure it whether or not the tools rise to meet the cognitive demands imposed on the programmers by the language's unique structure and features. We have it pretty good in Java thanks to NB and other IDEs.

But hey, I was sure the NB team was going to be all over this one. Is that not right?

Posted by guest on February 19, 2009 at 11:43 PM PST #

Hey Geertjan,

A similar situation exists for LISP programmers. Wags have called LISP Lots of Irritating Single Parenthesis because in LISP you have a great many levels, like 20 or more, of nested parenthesis and what the program means depends on what's scoped by those parenthesis. Your program be interpreted and be run just fine but with a semantics you never intended.

I learned to program in LISP using emacs. emacs' concession to programmers on the user interface front with respect to the parenthesis issue was this- when you put the cursor on a closing paren, it would flip back and forth between that closing paren and its associated opening paren, showing each in reverse video for a beat.

I also had to walk to school for three miles in the snow without shoes.

So quite your complaining ;)

Seriously, the success of JavaFX will lie in no small measure it whether or not the tools rise to meet the cognitive demands imposed on the programmers by the language's unique structure and features. We have it pretty good in Java thanks to NB and other IDEs.

But hey, I was sure the NB team was going to be all over this one. Is that not right?

Posted by softwarevisualization on February 19, 2009 at 11:44 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
24
25
26
27
28
29
30
   
       
Today