Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[graphiti-dev] Text underline && rich tooltips

  Hi,

  I've been working in a a change to allow rich text in graphiti, and I'd like some feedback, since I'm not totally sure my approach is the best.

  Currently, both in GFText and GFTextFlow graphiti uses (directly or not) graphics.drawText(), which allows very little customization. If we use graphics.drawTextLayout() instead, we could define subregions with underline, strikeout, different fore and background colors, font boldness, etc.... It's clearly less powerful than html parsing, as proposed in bug #373299, but I believe that's way too much work for the benefit.

  I've modified the graphiti ecore to resemble the TextLayout structure, like this. I've also made changes to GFText, GFMultilineText and GFTextFlow to properly draw the proposed structure. In order to support tooltips, I've added a getRichToolTip method to IToolBehaviorProvider, and a default implementation in DefaultToolBehaviorProvider for it that provides backwards compatibility by calling getToolTip. I've also played with SketchToolBehavior to provide a working example.

  All in all, it means changes in over 80 classes (many of them because of the model changes). I don't feel any confident at all in my knowledge of gerrit, in order to publish a branch for you to see it and comment on it. Could you please guide me on how to push these changes to gerrit so they can be reviewed?

  Regards,
Félix Velasco


Back to the top