Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drawing Graph on top of background image
Drawing Graph on top of background image [message #1780025] Tue, 16 January 2018 15:20 Go to next message
Kyle Girard is currently offline Kyle GirardFriend
Messages: 12
Registered: March 2012
Junior Member
I'm currently playing around with the gef5 and the mindmap tutorials. I have the basic editor included in my e4 application. I would like to change the background of the editor so that my graph is drawn on an image instead of the standard grid or white.... I've figured out how to enable or disable the grid via:

getContentViewer().getAdapter(GridModel.class).setShowGrid(false);

but when I attempt to set the background of the viewer using

getContentViewer().getCanvas();
parent.setStyle("-fx-background-image: url('" + imageUrl.toExternalForm() + "'); " +
"-fx-background-position: center center; " +
"-fx-background-repeat: stretch;");

just before I activate and populate my graph ... it appears initially until I click on the graph or move a node.... then reverts to white. So this is obviously not the place to do it...

Where/How do I set the background of the IViewerCanvas such that it is stays while the graph is manipulated?

Re: Drawing Graph on top of background image [message #1785408 is a reply to message #1780025] Fri, 13 April 2018 13:55 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Kyle,

the style is set by FocusBehavior IIRC, i.e. you should exchange the FocusBehavior and ensure that the correct styles are applied to your viewer.

This is the case, because a blue border is displayed when the viewer has focus. Therefore, the style is set by FocusBehavior by default every time viewer focus changes.

h2h
Matthias
Previous Topic:gef5 SimpleMindMapApplication with virtual nodes
Next Topic:GEF5 MVC Draw polygon
Goto Forum:
  


Current Time: Thu Apr 25 21:07:35 GMT 2024

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

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

Back to the top