Page 1 of 1

FID with no borders and/or with transparency (masking)

PostPosted: Tue May 18, 2010 10:22 pm
by ROCLASI
Since Java 5 (and certainly in Java 6) you can use borderless dialogs and/or dialogs with a mask (with alpha channels, i.e. transparency).
It would be very helpful to have such an advanced feature to make more compelling and appealing GUI's. Also it would be fairly easy to translate this 100% to the web as well.

I filled case #292965


Right now you can already take the decoration (borders/header) of a dialog with some inline java (courtesy of Troy Elliot of Data Mosaic) so it should be doable in plain Java as well (since it *IS* plain java).

EDIT: this specific piece of code only seems to work on Mac OS X.

Code: Select all
function onShow(firstShow, event) {
    if (firstShow) {
        // Code by Troy Elliot of Data Mosaic
        //get all the children windows that the top-level servoy form owns
        var allFrames = Packages.java.awt.Frame.getFrames()[0].getOwnedWindows()

        //loop through all children windows until we find the one we just opened
        for (var i = 0; i < allFrames.length && !thisFiD; i++) {

            //we found the form just opened
            if (allFrames[i].getName() == 'nameOfYourDialog') {
                //assign the FiD object to a variable to make the code easier to read
                var thisFiD = allFrames[i]

                //destroy FiD so it can be undecorated
                thisFiD.dispose()

                //undecorate FiD
                thisFiD.setUndecorated(true)

                //set to be modal because modal argument in application.showFormInDialog lost with dispose()
                thisFiD.setModal(true)

                //show FiD again
                thisFiD.setVisible(true)
            }
        }
    }
}


As for masking dialogs. You can take something like this:
Image

And show it in a real dialog with a real mask (instead of a transparant tabpanel like this):
Image

You might say, why use a dialog with mask for this when you can already do this with a transparant tabpanel ?
Answer: Simple, it doesn't have all those benefits of a real (modal) dialog.

And this is just ONE small example.


Here is also some Oracle/Sun info on making translucent/shaped windows:
http://java.sun.com/developer/technical ... d_windows/

Re: FID with no borders and/or with transparency (masking)

PostPosted: Tue May 18, 2010 10:29 pm
by Harjo
ROCLASI wrote:Since Java 5 (and certainly in Java 6) you can use borderless dialogs and/or dialogs with a mask (with alpha channels, i.e. transparency).
It would be very helpful to have such an advanced feature to make more compelling and appealing GUI's. Also it would be fairly easy to translate this 100% to the web as well.

I filled case #292965


+1!! :D

Re: FID with no borders and/or with transparency (masking)

PostPosted: Tue May 18, 2010 11:27 pm
by Providence1
I must have this!!!!

Re: FID with no borders and/or with transparency (masking)

PostPosted: Wed May 19, 2010 11:55 am
by jcompagner
Here is also some Oracle/Sun info on making translucent/shaped windows:
http://java.sun.com/developer/technical ... d_windows/

thats a real bad link.... (as an example)
Thats only for java 6u10 and higher AND it uses a "com.sun.awt.AWTUtilities" class that is not public api and can change at any point. (and doesnt have to ship in other none sun like mac java impl)

Re: FID with no borders and/or with transparency (masking)

PostPosted: Tue May 25, 2010 10:50 am
by Karel Broer
My vote for this feature too! 8)

Re: FID with no borders and/or with transparency (masking)

PostPosted: Tue May 25, 2010 10:43 pm
by Thomas Parry
+1

Re: FID with no borders and/or with transparency (masking)

PostPosted: Wed Dec 08, 2010 1:52 am
by maria
+1!

Re: FID with no borders and/or with transparency (masking)

PostPosted: Thu Apr 07, 2011 8:26 pm
by Karel Broer
Is there any news about this feature request? Could this be implemented in 6 ?