Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF5] Right way to set global visual effect
[GEF5] Right way to set global visual effect [message #1820560] Wed, 22 January 2020 20:52 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 169
Registered: July 2009
Senior Member
Hi

what is the right way to set a global effect?
E.g. the drop shadow of the Logo-example, but applied to all content parts.
But not applied to the grid dots.

I have this, and it works.
viewer.getRootPart().getVisual().setEffect(createShadowEffect());


Is the way it should be done?

Frank
Re: [GEF5] Right way to set global visual effect [message #1820576 is a reply to message #1820560] Thu, 23 January 2020 09:04 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Frank,

if you apply the effect like that, it will also affect feedback and handle parts. You can restrict it to only affect content parts by accessing the content layer group, assuming you are using the default LayeredRootPart, as follows:

((LayeredRootPart) viewer.getRootPart()).getContentLayer().setEffect(effect);


When applying effects, it is important to know that each node can only have a single effect applied to it, i.e. you cannot easily stack effects on a single node. However, you can use the input-property of some effects to wire them with others in order to achieve more complex effects.

That's why, in some situations, you will have to adjust the scene graph in order to allow multiple effects on your nodes. When necessary, you can introduce more Groups to your visuals to allow multiple stacked effects.

The grid dots are rendered using JavaFX CSS. Therefore, I would not expect them to be affected by an effect that is applied, for example, to the InfiniteCanvas or its grid canvas.

Best regards,
Matthias
Re: [GEF5] Right way to set global visual effect [message #1820611 is a reply to message #1820576] Thu, 23 January 2020 21:31 Go to previous message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 169
Registered: July 2009
Senior Member
Hi Matthias,

Thanks for you help.

Frank
Previous Topic:bug in mvc logo example
Next Topic:Advice on migrating an app from GEF 3 to GEF 5 (MVC)
Goto Forum:
  


Current Time: Mon Sep 26 06:46:08 GMT 2022

Powered by FUDForum. Page generated in 0.02063 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top