Skip to main content



      Home
Home » Eclipse Projects » GEF » Tooltips for Edges
Tooltips for Edges [message #1749810] Mon, 12 December 2016 11:03 Go to next message
Eclipse UserFriend
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 11:05] by Moderator

Re: Tooltips for Edges [message #1749813 is a reply to message #1749810] Mon, 12 December 2016 12:23 Go to previous messageGo to next message
Eclipse UserFriend
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 06:16 Go to previous messageGo to next message
Eclipse UserFriend
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 03:40 Go to previous messageGo to next message
Eclipse UserFriend
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 10:52 Go to previous message
Eclipse UserFriend
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: Wed Apr 30 04:16:43 EDT 2025

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

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

Back to the top