StageStyle and unified toolbars on the Mac

Pavel Safrata pavel.safrata at oracle.com
Thu Feb 23 05:53:55 PST 2012


Kevin, if I understand the request correctly, the goal is to have system 
default background, not transparent one and not white one.
Pavel

On 23.2.2012 14:47, Kevin Rushforth wrote:
> But since there will always be a Scene, wouldn't the following suffice?
>
>    scene.setFill(Color.TRANSPARENT);
>    stage.initStageStyle(StageStyle.DECORATED_TRANSPARENT);
>    stage.setScene(scene);
>
> -- Kevin
>
>
> Stephen Winnall wrote:
>> Hi Kevin
>>
>> Whereas DECORATED_TRANSPARENT is also a possible desirable 
>> StageStyle, it wouldn't solve my problem. I just need 
>> DECORATED_WITHOUT_ANYTHING_ELSE (what I call bare boards). I think 
>> the point is that the Stage should not provide any sort of 
>> background, just what the native windowing system provides. Any 
>> background is a task for the Scene. In my view, instead of 
>> StageStyle, Stage should have provided #decorated, #transparent and 
>> #utility as three independent properties.
>>
>> Cheers
>> Steve
>>
>> On 23 Feb 2012, at 14:04, Kevin Rushforth wrote:
>>
>>> Thanks for filing this. I added the following comment to the JIRA:
>>>
>>> "One way to provide the desired capability would be to add 
>>> StageStyle.DECORATED_TRANSPARENT, perhaps with a shorter name."
>>>
>>> -- Kevin
>>>
>>>
>>> Stephen Winnall wrote:
>>>> Given the text of the StageStyle Javadoc:
>>>>
>>>> "    DECORATED
>>>>     Defines a normal Stage style with a solid white background and 
>>>> platform decorations.
>>>>
>>>>     TRANSPARENT
>>>>     Defines a Stage style with a transparent background and no 
>>>> decorations.
>>>>
>>>>     UNDECORATED
>>>>     Defines a Stage style with a solid white background and no 
>>>> decorations.
>>>>
>>>>     UTILITY
>>>>     Defines a Stage style with a solid white background and minimal 
>>>> platform decorations used for a utility window.
>>>> ", I suspect the software is performing to spec., i.e. it's not a 
>>>> bug, strictly speaking :-)
>>>>
>>>> But I've submitted a feature report  (I'm not that familiar with 
>>>> Jira and am new to JavaFX 2). You can see it at
>>>>
>>>>     http://javafx-jira.kenai.com/browse/RT-19834
>>>>
>>>> Cheers
>>>> Steve
>>>>
>>>> On 22 Feb 2012, at 19:27, Richard Bair wrote:
>>>>
>>>>> Hmm, tried a transparent background but it didn't look like it 
>>>>> would work. You may want to file a bug on this.
>>>>>
>>>>> Thanks
>>>>> Richard
>>>>>
>>>>> On Feb 22, 2012, at 7:04 AM, Stephen Winnall wrote:
>>>>>
>>>>>> I'm trying to create a unified toolbar on the Mac using JavaFX 
>>>>>> 2.1 b13. For those who don't know what that is, there's an 
>>>>>> example (albeit for Qt) at
>>>>>>
>>>>>>     http://labs.qt.nokia.com/wp-content/uploads/2007/03/oldandunified.png 
>>>>>>
>>>>>>
>>>>>> (The bottom variant is the unified toolbar).
>>>>>>
>>>>>> I've managed this with Swing using Java 1.6. You do it by 
>>>>>> creating a JFrame with apple.awt.brushMetalLook set to TRUE and 
>>>>>> adding a transparent JToolBar at the top of the frame. It looks 
>>>>>> like this (after appropriate styling of the JToolBar and its 
>>>>>> buttons):
>>>>>>
>>>>>>     http://yfrog.com/mrh1ydp
>>>>>>
>>>>>> You can then add further content (e.g. in a JPanel with a white 
>>>>>> background) after the toolbar.
>>>>>>
>>>>>> I can't see how to do this with JavaFX. In fact, I suspect it is 
>>>>>> impossible, because a Stage either has a solid white background 
>>>>>> or is completely transparent according to StageStyle. Is there 
>>>>>> any way of suppressing the sold white background? Why does a 
>>>>>> Stage have to have a white background at all? Shouldn't it just 
>>>>>> provide the boards (to stick with the theatre metaphor)? The 
>>>>>> white background belongs to the scene, surely?
>>>>>>
>>>>>> Perhaps there's another way of making a unified toolbar?
>>>>>>
>>>>>> Cheers
>>>>>> Steve
>>>>
>>


More information about the openjfx-dev mailing list