rocketmail / jfxflow

Automatically exported from code.google.com/p/jfxflow
0 stars 0 forks source link

More input for the wishlist #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
I am just reconsidering how I could best use JFXFlow in a project of mine. Here 
are few things I would need and I think these might also be of general interest 
(in addition to the ones we have already discussed).

Run the browser in full-screen mode:
This would be needed in order to use JFXFlow as a slide-show engine. This 
raises a couple of other issues.

Decouple the browser bar from the browser view and leave it to the programmer 
to arrange them:
There should also be proper interfaces defined so that the programmer can for 
example implement his own browser bar. In my case something that is located at 
the bottom and fades in and out when the mouse enters it.

One should also consider the case where I have more than one browser: One is 
running in full screen mode on the secondary monitor and another one is running 
on the primary screen in normal mode and shows the controls. (I have not yet 
checked whether that is possible in JavaFX at all.)

I'd also like to be able to couple the browser with a tree view (like in the 
ensemble demo)

Just a few thoughts to keep you busy over the otherwise boring christmas days 
:-)

MiPa

Original issue reported on code.google.com by m...@jugs.org on 10 Dec 2011 at 1:02

GoogleCodeExporter commented 8 years ago
I just learned by reading your blog  post on JavaFX and MVP that some of my 
wishes have already come true :-) Probably I have not realized that these are 
already possible right now.
MiPa

Original comment by m...@jugs.org on 11 Dec 2011 at 12:52

GoogleCodeExporter commented 8 years ago
Yea, I was going to send you a link to that, you beat me to it :)

In general everything you want is possible and part of the JFX Flow design, 
with the possible exception of having a full screen window and a normal one 
open at the same time - just depends on whether JFX will let you do this or not.

A Browser is just another Node in the scene, so you can have as many as you 
want and embed them wherever you want. You can create a new Stage and pop-up a 
new Browser in it if you want. You can either share a NavigationManager between 
them (so they are in-synch on what page they are showing) or you could create a 
different NavigationManager for each. You could for example, create a 'tabbed' 
browser where each tab is a new Browser instance with its own 
NavigationManager. 

The only thing that can get a bit weird with this is the glasspane. It will 
cover only the Browser it is used within. Sometimes this may be what you want 
(e.g. the tabbed browser will block only that tab), other times it might not 
be. It's a bit more work but you can sort this out through custom glasspane 
handling.

Browsers are also meant to be fully customisable and stylable. In my 
applications at the moment, I end up creating my own Browsers because they need 
to be fully styled. I have something not unlike the JFX Ensemble browser in my 
app (without the tree) - using an undecorated stage and providing my own 
maximise/minimise buttons, etc. 

For simple/common customisations I've made it so you can set the header and 
footer on the Browser very easily (sacrificing a little bit of design purity 
here for real-world efficiency). You can set it to null to turn it off 
completely, or you can put whatever you like in there - in the 
com.zenjava.jfxflow.control package you can find things like 'BackButton', etc 
to help you assemble your own toolbars if you want (just pass in the 
NavigationManager).

I haven't done anything with side bars yet (i.e. left and right areas where you 
could stick something like a Tree) but it would be trivial to add this. I 
wasn't sure whether I should use a SplitPane or not for this so I didn't want 
to lock in an option before I had a chance to think about it more. Probably it 
should be a splitpane (and probably there should be a bottom splitpane as well, 
that sits above the footer). One other issue was whether the 'busy' glasspane 
should cover these side panels or not - still undecided about that one (what 
would your usecase prefer?), but it possibly could be left to the skinning and 
therefore easily customised. 

I have written the Browser to be fully skinnable (i.e. you can write your own 
skin class to make it look/layout however you want!) but unfortunately there is 
a bug in the way Control.getUserAgent stylesheets are loaded when in Webstart 
deployment (the JFX classloader is different to the application one in this 
environment so it doesn't find my default stylesheet). Jonathan says this bug 
has been fixed in 2.0.2 which is due out soon. Until then I have just hacked 
the code to extend Panes and I set the 'skin' as the center child - this will 
go as soon as I get 2.0.2. If you want to do 'skinning' right now, you could 
just call Browser.setCenter(yourSkin) as a little cheat (I'd probably copy 
BrowserSkin into my own class and use this as the template for my custom skin). 

Failing all that you can write your own Browser (as I do in my code). This is 
not too bad but it is not as simple as I'd like yet. I need to compartmentalise 
the Browser code to form 'lego' blocks you can use in your own code. For 
example, the transition code is all built into the Browser at the moment but I 
want to move this out to a TransitionManager that you can just use in your own 
Browser (and CardLayout style ActivityPanes that for child activities) - this 
will also be the mechanism for installing your own default Transitions, etc. 
It's high on the todo list and will be done along with the animation factory 
stuff we've been talking about. 

Also, just as an additional extra. JFX actually provides a way to interact with 
the real 'browser' url when running in a web browser (chrome, IE, etc). They 
use this in the Applet version of webstart to hook into the browsers 
forward/back button. This is kind of neat feature and I have a rough plan to 
integrate this sort of thing into Flow at some point in the future (a bit lower 
on the priority list). That way you could for example embed your whole 
application within a normal web browser and use it from within there (which 
users like to do, even though there is no real benefit). In your case you could 
have your main app in the browser and popup another stage (possibly in full 
screen mode) to do your slide show.  

Since the docco for all of this is still pretty raw, feel free to email me 
direct with questions etc and I'll work through stuff with you. I think Flow 
will do what you want though, and if it doesn't I am very open to growing it if 
the features would benefit others. I am planning to move the form/validation 
stuff from my playground 
(http://code.google.com/p/jfxee/source/browse/trunk/jfxforms/) into flow in the 
not too distant future too since I need this for my project soon. 

Cheers, 
zonski

Original comment by zonski on 11 Dec 2011 at 10:01