Skip to main content



      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 10:20 Go to next message
Eclipse UserFriend
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 09:55 Go to previous message
Eclipse UserFriend
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: Fri Apr 18 09:32:41 EDT 2025

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

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

Back to the top