Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Tooltips for Edges
Tooltips for Edges [message #1749810] Mon, 12 December 2016 16:03 Go to next message
Thomas Johnsson is currently offline Thomas JohnssonFriend
Messages: 10
Registered: June 2010
Junior Member
Can one have tooltips for edges? If so, how? If not, maybe one can have tooltips for label objects of the edges? If so, how?
Examples please!

Thanks in advance!
Thomas

[Updated on: Mon, 12 December 2016 16:05]

Report message to a moderator

Re: Tooltips for Edges [message #1749813 is a reply to message #1749810] Mon, 12 December 2016 17:23 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Are you talking of Zest 1.x or Zest 5.x ?
Re: Tooltips for Edges [message #1749866 is a reply to message #1749813] Tue, 13 December 2016 11:16 Go to previous messageGo to next message
Thomas Johnsson is currently offline Thomas JohnssonFriend
Messages: 10
Registered: June 2010
Junior Member
GEF4/Zest 1.0.1.201609060946 is what working with now, so I guess 5.x
Re: Tooltips for Edges [message #1749945 is a reply to message #1749866] Wed, 14 December 2016 08:40 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Thomas,

JavaFX provides Tooltip [1] that can be installed to a JavaFX Node in the scene graph. Within Zest such a Tooltip is installed for nodes if they specify a tooltip text via their attributes (ZestProperties#TOOLTIP__N).

Currently, Zest does not provide tooltips for edges (or edge labels). In order to support such functionality, you would need to subclass EdgePart (or EdgeLabelPart) and specialize doRefreshVisual() as follows:
public class CustomEdgePart extends EdgePart {
    private Tooltip tooltip;
    @Override
    public void doRefreshVisual(Connection visual) {
        super.doRefreshVisual(visual);
        // refresh tooltip
        Map<String, Object> attr = getContent().getAttributes();
        boolean hasTooltip = false;
        if (attr.containsKey("tooltip")) {
            String tooltipText = attr.get("tooltip");
            if (hasTooltip = tooltipText != null && !tooltipText.isEmpty()) {
                if (tooltip == null) {
                    tooltip = new Tooltip(tooltipText);
                    Tooltip.install(visual);
                } else {
                    tooltip.setText(tooltipText);
                }
            }
        }
        if (!hasTooltip && tooltip != null) {
            Tooltip.uninstall(visual, tooltip);
            tooltip = null;
        }
    }
}


I think it is a good idea to support tooltips for edges and labels, so feel free to file a Bugzilla ticket for the missing functionality [2].

[1] https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Tooltip.html
[2] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GEF

Best regards,
Matthias
Re: Tooltips for Edges [message #1781200 is a reply to message #1749945] Fri, 02 February 2018 15:52 Go to previous message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 157
Registered: February 2016
Senior Member
I created a bugzilla ticket to request this feature: https://bugs.eclipse.org/bugs/show_bug.cgi?id=530658
Previous Topic:[GEF]Call rotate in paintFigure but moveHandle isn't rotated
Next Topic:FreeformLayer repaint problem
Goto Forum:
  


Current Time: Fri Apr 19 10:43:06 GMT 2024

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

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

Back to the top